Type alias ClientOpts

ClientOpts: {
    Blob?: BlobCtorType;
    FormData?: FormDataCtorType;
    WebSocket?: WebSocketCtorType;
    actAs?: Record<string, unknown>;
    apiHost?: string;
    base64url?: ((data) => string);
    fetch?: Fetch;
    hmacSha256?: ((key, data) => Promise<Uint8Array>);
    orgId?: string;
    wsPingIntervalMs?: number;
}

Options for the StateBacked client.

Type declaration

  • Optional Blob?: BlobCtorType

    Blob implementation to use.

    Defaults to globalThis.Blob.

  • Optional FormData?: FormDataCtorType

    FormData implementation to use.

    Defaults to globalThis.FormData.

  • Optional WebSocket?: WebSocketCtorType

    WebSocket implementation to use.

    Defaults to globalThis.WebSocket.

  • Optional actAs?: Record<string, unknown>

    The claims representing the user we are acting as.

    This will cause all requests to fail if used with a non-admin token that does not have sufficient permission to create keys.

  • Optional apiHost?: string

    The API host to use. Defaults to https://api.statebacked.dev.

  • Optional base64url?: ((data) => string)
      • (data): string
      • Base64url implementation to use.

        Parameters

        • data: Uint8Array

        Returns string

  • Optional fetch?: Fetch

    Fetch implementation to use.

    Defaults to globalThis.fetch.

  • Optional hmacSha256?: ((key, data) => Promise<Uint8Array>)
      • (key, data): Promise<Uint8Array>
      • HMAC SHA256 implementation to use.

        Should return the HMAC SHA256 of the data using the key.

        Parameters

        • key: Uint8Array
        • data: Uint8Array

        Returns Promise<Uint8Array>

  • Optional orgId?: string

    The organization ID to use. Only required if you are using an admin session (e.g. the smply CLI) AND you belong to more than one organization.

    If you are using a JWT signed with a key generated with smply keys create (the standard case), you do not need to set this.

  • Optional wsPingIntervalMs?: number

    Number of milliseconds between keep alive pings on any open WebSocket connections.

    Defaults to 5 minutes.

Generated using TypeDoc