Associates the current app session with a specific user account.

Purpose

The identify method tells UserKit who the current user is, enabling personalized call experiences and proper user management in the UserKit dashboard. This must be called before initiating calls.

Signature

func identify(id: String, name: String? = nil, email: String? = nil)

Parameters

NameTypeDescription
idStringA unique identifier for the user. Should not be guessable and must be unique per user
nameString?Optional display name for the user
emailString?Optional email address for the user

Returns

This method does not return a value.

Usage

Basic Identification

// Identify user with just an ID
UserKit.shared.identify(id: "008a4c5f-1d51-48a9-81de-51346eeae6dc")

Full User Information

// Identify user with all available information
UserKit.shared.identify(
  id: "user_12345",
  name: "John Doe",
  email: "john@example.com"
)

Best Practices

  1. Do not make your user IDs guessable – they are public facing
  2. Ensure the ID is unique per user
  3. Do not use device IDs for user IDs - this will result in multiple user records as device IDs rotate
  4. Call this method after user authentication in your app
  5. Update user information if it changes during the session

Notes

  • The name and email parameters are optional but recommended for better user experience
  • User information will appear in the UserKit dashboard
  • This method can be called multiple times to update user information