API Core - v1.5.0
    Preparing search index...

    Interface LifecycleEvents<TSyncParams>

    Callback bundle invoked around SDK lifecycle moments. All callbacks are optional and non-throwing — the SDK ignores any exceptions they raise so a buggy observer cannot break the request flow.

    Two scopes coexist here:

    • Per-request (onRequest*) — fires for every outgoing HTTP call.
    • Per-sync (onSyncComplete) — fires after each sync trigger (auto-timer OR a sync-decorated mutation), once the downstream device state has been refreshed.
    interface LifecycleEvents<TSyncParams = unknown> {
        onAuthenticationLost?: () => void;
        onAuthenticationRestored?: () => void;
        onRequestComplete?: (event: RequestCompleteEvent) => void;
        onRequestError?: (event: RequestErrorEvent) => void;
        onRequestRetry?: (event: RequestRetryEvent) => void;
        onRequestStart?: (event: RequestLifecycleContext) => void;
        onSyncComplete?: SyncCallback<TSyncParams>;
    }

    Type Parameters

    • TSyncParams = unknown

      Shape of the consumer-defined parameters the sync notification carries (device ids, type filters…).

    Index
    onAuthenticationLost?: () => void

    Fires when a previously-available session is definitively lost: the boot-time restore found persisted state but could not sign in, or a sync cycle ended unauthenticated after the auth-retry chain gave up. The auto-sync disarms at the same moment (rescheduling would hammer the account with a doomed sign-in every cycle); a successful authenticate() — e.g. the user logging back in — re-arms it. Fires once per loss episode.

    onAuthenticationRestored?: () => void

    Fires when a sync cycle ends authenticated after an onAuthenticationLost episode — the user logged back in or a retry recovered the session. Fires once per loss episode, so the two events always alternate.

    onRequestComplete?: (event: RequestCompleteEvent) => void

    Invoked after a successful HTTP response is received.

    onRequestError?: (event: RequestErrorEvent) => void

    Invoked when a request fails permanently (retries exhausted).

    onRequestRetry?: (event: RequestRetryEvent) => void

    Invoked before each backoff-scheduled retry attempt.

    onRequestStart?: (event: RequestLifecycleContext) => void

    Invoked when a request is dispatched for the first time.

    onSyncComplete?: SyncCallback<TSyncParams>

    Invoked after each sync trigger (auto-timer or a sync-decorated mutation), with the consumer-defined scoping parameters.