Skip to main content

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:
Call identify() as soon as you know the user’s ID. All subsequent events will be associated with this user.

Get User Information

Alias Anonymous to Identified

When a user signs up, merge their anonymous identity with their new user ID:
This ensures all events from before signup are associated with the user.

Reset User

Reset user identity on logout:
After 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:
Traits are included in all subsequent events and can be used for feature flag targeting.

Next.js Integration

Client Components

Server Components

Best Practices

Call identify() as soon as you know the user’s ID to associate all events with the user.
Always alias the anonymous ID with the user ID when a user signs up to preserve event history.
Call reset() when users log out to start a fresh session for the next user.
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