By default, when a user navigates to a new page on a multi-page website, the Web SDK unmounts and the agent session ends. Persistence mode changes this: the agent session survives full page navigation, so the conversation continues seamlessly as users move between pages.
What persistence mode does
With persistence mode enabled, a user who starts a conversation on your homepage can navigate to a product page, a checkout page, or any other page on your site and continue the same conversation without losing context. The agent stays visible, the session state is preserved, and no new session is created.
This is similar to what Napster built for F1 — now productized and available to all developers.
How to enable persistence mode
Pass persistence: true when initialising the SDK:
NapsterCompanionApiSdk.init(token, {
mountContainer: containerRef.current,
position: "bottom-right",
persistence: true
});When persistence mode is active:
- The SDK maintains session state across page loads.
- The agent reconnects on each new page without requiring a new token or a new server-side session.
- Conversation history is preserved throughout the user's visit.
- The agent widget remains visible and in position as the page changes.
When to use persistence mode
| Use case | Why persistence helps |
|---|---|
| E-commerce | User browses homepage → product page → cart → checkout without restarting the agent conversation |
| Documentation sites | User asks a question on one doc page and continues on another without losing context |
| Multi-step onboarding flows | Agent guides a user through a multi-page signup or configuration flow as a single conversation |
| Any site with a top navigation | Users who click between sections keep their agent context without needing to re-explain themselves |
Requirements
- Web SDK (WebRTC channel only).
- Your site must use standard page navigation (full page loads). Single-page applications (SPAs) that manage routing client-side do not trigger page navigations and do not need persistence mode — the SDK stays mounted automatically.
First release
Persistence mode is in its first release. Napster is actively gathering feedback from real integrations to improve it. If you encounter issues or have feedback, share it in the Napster developer community on Discord.
Full guide: developers.napster.com/docs/sdks/web-sdk/persistence