SDK

Reset

Clear the current user's identity, frequency caps, and dismissals on logout.

Chirp.reset is the logout counterpart to Chirp.identify. Call it when your user signs out so the next person on the device doesn't inherit their state.

Signature

Chirp.reset(): void

Synchronous. Takes no arguments.

Usage

function onLogout() {
  // your auth lib's logout
  await signOut();

  // clear ChirpBack state
  Chirp.reset();
}

What it clears

  • The user's identity (email, fullName, additionalData, etc.)
  • The anonymous device ID — a fresh one is generated for the next anonymous session
  • Frequency caps and cooldowns (surveys and announcements can show again)
  • Persistent dismissals (an announcement the previous user dismissed may now show)
  • The bootstrap cache (next interaction refetches with the new anonymous identity)

What it does not clear

  • Consent. Consent persists across logouts. If you also want to revoke consent, call Chirp.consent.revoke() explicitly.
  • The SDK's loaded state. init does not need to be called again after reset.

When to call it

  • On explicit user logout
  • After deleting the user's account
  • When switching between user accounts in the same browser tab

When not to call it

  • Don't call on page reload / refresh — that's not a logout, and the SDK persists identity across reloads on purpose.
  • Don't call when the user is still signed in. There's no use case where an active user wants their frequency caps reset.

Next steps

On this page