Documentation
    Preparing search index...
    • Submits all queued events now, batch by batch, using the current credentials.

      Call this before logging out or switching user so the active user's queued events are delivered while their credentials are still available.

      Waits for any sendEvent() calls that have not yet reached the queue, then submits. Resolves when the queue is empty or a batch fails (outage / non-OK response); in the failure case the remaining events stay queued and are retried by the scheduler. Rejects if no credentialsProvider is set or getCredentials() rejects.

      With { discardUnsent: true } whatever is still queued after the submit attempt is dropped from memory and IndexedDB, and the promise resolves once the store is confirmed empty. See FlushOptions.

      If a scheduled submit is already running, this awaits that run instead of starting a second one.

      Parameters

      Returns Promise<FlushResult>