- Feature flags targeted by user properties
- Feedback that persists across devices for the same user
- Analytics grouped by user rather than device
Identify a user
async — identify clears the feedback and flag caches so the next read re-fetches under the new identity.
All services (feedback, flags) automatically use this context after identification. Caches are cleared on identity change so services re-fetch with the new context.
UserContext
Properties are used for feature flag targeting and segmentation. Common examples:
"plan":"free","pro","business""country":"US","DE","JP""beta_tester":"true""company_size":"50"
Subject ID (subscription sharing unit)
Separate from user identity,setSubjectId links the device to a sharing unit (family/household) for subscription entitlement claims (SDK 2.1.0+, Enterprise):
identify, these three are synchronous and do not clear any caches. Set the subject id before calling validateAttestation(). The id rides the next attestation or token refresh; the backend then projects custom_claims.subscription into the JWT for every device sharing the same id. Use the identical value as the StoreKit appAccountToken and Stripe client_reference_id.
Don’t confuse the two:
Device context (automatic)
The SDK automatically collects device context — you don’t need to set this:DeviceContext is captured when you construct the UserContext, so it reflects the app and OS at that moment. You can’t set these fields yourself; your own properties take precedence if you use the same key.