SDK Reference
identify()
Associate your user ID with Encore
Links your user ID to the SDK’s anonymous ID for cross-device entitlement tracking and attribution. Call this after a successful login to sync the user’s entitlements across devices.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Associate your user ID with Encore
identify(userId: string, attributes?: UserAttributes): Promise<{ success: boolean }>
| Name | Type | Description |
|---|---|---|
userId | string | Your user’s unique identifier from your auth system |
attributes | UserAttributes | Optional structured attributes to set in one call |
await Encore.identify(user.id);
await Encore.identify(user.id, {
email: user.email,
subscriptionTier: user.plan,
monthsSubscribed: String(user.monthsActive),
});
identify() after a successful login. On logout, call reset() to clear the user ID and cached entitlements.