API Core - v2.4.1
    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 the session is definitively lost — when nothing automatic can end the loss: the stored credential was refused (by a resume at boot, a deferred retry or the reactive re-auth), or a persisted session died with no credential to sign back in with. The user has to act, typically by signing in again. A TRANSIENT failure — a transport blip, a server error — fires nothing: the resume is retried every minute until it succeeds (2.4.0). On a definitive loss the auto-sync disarms (rescheduling would hammer the account with a doomed sign-in every cycle); a successful authenticate() re-arms it. Fires once per loss episode.

    onAuthenticationRestored?: () => void

    Fires when a sync cycle ends authenticated after an onAuthenticationLost episode — after the accepted sign-in that ends it, since a refused credential is never retried automatically. Fires once per loss episode, so the two events always alternate; a transient failure, having fired no loss, fires no recovery either.

    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.