Core Concepts
Sessions
Anonymous visitor tracking, authenticated user sessions, and cross-tab persistence.
Overview
A Session encapsulates a continuous visitor interaction period on your website. Sessions allow the assistant to remember conversation history as a user navigates between pages.
Anonymous vs Identified Sessions
- Anonymous Sessions: The default state. The SDK generates a cryptographically random UUID stored in
localStorage. No PII is collected.
- Identified Sessions: When a visitor logs into your application, you can pass their user identifier to the SDK:
Asiyst.identify({userId: "usr_12345",
traits: {
plan: "Enterprise",
company: "Acme Corp",
},
});
Session Persistence
The SDK synchronizes state across browser tabs using BroadcastChannel and StorageEvent listeners. If a visitor opens multiple tabs on your website, all tabs share the same assistant state and conversational context in real time.
Session Termination
Sessions automatically conclude when:
- The visitor has been inactive for 30 minutes.
- The SDK
Asiyst.logout()method is called explicitly.
- The user clears their browser local storage.
See Visitor Sessions Guide for advanced identity management.