Skip to main content
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.

Signature

identify(userId: string, attributes?: UserAttributes): Promise<{ success: boolean }>

Parameters

NameTypeDescription
userIdstringYour user’s unique identifier from your auth system
attributesUserAttributesOptional structured attributes to set in one call

Usage

Basic identification

await Encore.identify(user.id);

With attributes

await Encore.identify(user.id, {
  email: user.email,
  subscriptionTier: user.plan,
  monthsSubscribed: String(user.monthsActive),
});
Call identify() after a successful login. On logout, call reset() to clear the user ID and cached entitlements.