Documentation
    Preparing search index...

    Type Alias FlushOptions

    type FlushOptions = {
        discardUnsent?: boolean;
    }
    Index
    discardUnsent?: boolean

    After submitting what can be submitted, discard whatever is still queued, from memory and from IndexedDB, so nothing is left behind for the next user.

    Discarded events are lost for good, including playback events that count towards the user's listening history. Only set this when the outgoing user's data must not remain on the device, i.e. signing out on a shared, public or otherwise untrusted device. On a personal device prefer a plain flush(); leftover events are delivered on a later run and stay attributed to the user who produced them. Never call this on a schedule, at startup, on token refresh or as a general clean-up.

    With this option set, flush() does not reject when submission fails (e.g. no user is logged in any more); the unsent events are discarded and reported in the result instead.