User Identification
The Solute SDK automatically manages user identification and sessions. Learn how to identify users and work with sessions.Anonymous vs Identified Users
The SDK supports two types of user identification:- Anonymous users: Automatically assigned an anonymous ID. Used before user login.
- Identified users: Assigned a user ID when you call
identify(). Used after user login.
Identify Users
Identify a user when they log in or sign up:Get User Information
Alias Anonymous to Identified
When a user signs up, merge their anonymous identity with their new user ID:Reset User
Reset user identity on logout:reset(), the SDK will:
- Clear the user ID
- Generate a new anonymous ID
- Start a new session
- Clear user traits
Session Management
Sessions are automatically managed by the SDK:- Session creation: A new session starts when the SDK initializes
- Session timeout: Sessions expire after 30 minutes of inactivity (configurable)
- Session ID: Each session has a unique ID that’s included in all events
Configure Session Timeout
User Traits
Store user properties as traits:Next.js Integration
Client Components
Server Components
Best Practices
Identify early
Identify early
Call
identify() as soon as you know the user’s ID to associate all events with the user.Alias on signup
Alias on signup
Always alias the anonymous ID with the user ID when a user signs up to preserve event history.
Reset on logout
Reset on logout
Call
reset() when users log out to start a fresh session for the next user.Update traits regularly
Update traits regularly
Keep user traits up to date by calling
identify() when user properties change.Next Steps
Event Tracking
Learn about tracking events
Next.js Integration
Deep dive into Next.js integration
