Skip to main content
Identifying users lets you connect SDK sessions to real users in your system and target specific segments for studies.

Set an external ID

Link the SDK session to a user in your system. This is typically the user ID from your database or auth system.
PillowSDK.shared.setExternalId(externalId: "user_123")
Call this after login or whenever the user’s identity is known.
The external ID must not be blank.

Set user properties

Attach metadata to the user for targeting and segmentation.

String

PillowSDK.shared.setUserProperty(key: "plan", stringValue: "pro")
PillowSDK.shared.setUserProperty(key: "role", stringValue: "engineering")
PillowSDK.shared.setUserProperty(key: "locale", stringValue: "en-US")

Boolean

PillowSDK.shared.setUserProperty(key: "email_verified", booleanValue: true)
PillowSDK.shared.setUserProperty(key: "beta_user", booleanValue: false)

Numeric

PillowSDK.shared.setUserProperty(key: "login_count", intValue: 7)
PillowSDK.shared.setUserProperty(key: "lifetime_value", doubleValue: 49.5)

Clear properties

// Remove a single property
PillowSDK.shared.clearUserProperty(key: "plan")

// Remove all properties
PillowSDK.shared.clearAllProperties()

When to identify

EventAction
User logs inCall setExternalId() and set known properties
User updates profileCall setUserProperty() with new values
User logs outCall reset() to clear identity and start fresh
App launch (already logged in)Call setExternalId() again — the SDK deduplicates