Skip to main content
Call Wendung.reset() when the current user logs out. It attempts to send queued events through sendBeacon(), then clears the stored user ID and traits and generates new session and anonymous IDs. It returns immediately without waiting for the requests to settle. Queued events keep the identity and session captured when they were recorded, including events re-queued after a failed send. The SDK stays initialized: the flush timer and lifecycle listeners keep running, and subsequent step() calls are attributed to a fresh anonymous session. Throws if called before init().

Parameters

None.

Returns

void

Examples

Logout handler

Account switching

To wait for a send attempt across the whole queue, call await Wendung.sendBeacon() before reset(). This does not guarantee delivery: network and server failures are re-queued, while 4xx responses drop the affected batch. If fetch is unavailable, events stay queued.