Type alias AuthTokenProvider

AuthTokenProvider: (() => Promise<string>)

Host-provided function that supplies an auth token (JWT) to the SDK.

Invoked by the native SDK when it needs a token. Returns a Promise that resolves with the current end-user's JWT, or rejects if a token cannot be obtained.

Connectivity failures: if the provider rejects because the device is offline, the SDK can wait for connectivity to return and retry — but only when it can recognize the failure as a network error. The bridge auto-detects React Native's fetch network failure (TypeError: Network request failed) and AbortError. If the host uses a different HTTP client, it can opt in explicitly by rejecting with an error carrying isConnectivityError === true:

throw Object.assign(new Error('offline'), { isConnectivityError: true });

All other rejections are treated as non-connectivity failures (no connectivity-driven retry), matching the native SDKs' error classification.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>