RevTurbineUserContext
SDK-local user context state.
Extends the canonical UserContextInput with a local id field
for user identification. The full persistence-ready UserContext
(with tenant_id, user_id, timestamps) is built by the SDK via
getUserContext().
custom is widened to Record<string, unknown> at the SDK boundary
for customer convenience; values are narrowed to TraitValue when
persisted via the API.
Extends
Section titled “Extends”Omit<UserContextInput,"custom"|"entitlements"|"usage"|"personalization"|"derived_computed_at"|"context_hash">
Properties
Section titled “Properties”context_hash?
Section titled “context_hash?”
optionalcontext_hash?:string|null
Server-computed user-context hash (plan 74). Optional at the SDK input
boundary for the same reason as derived_computed_at.
custom?
Section titled “custom?”
optionalcustom?:SdkTraits
Customer-defined fields for segmentation and personalization.
derived_computed_at?
Section titled “derived_computed_at?”
optionalderived_computed_at?:string|null
Server-computed derived-entitlement cache stamp (plan 74). Optional at the
SDK input boundary — local mode does not compute it; the control plane
populates and round-trips it, defaulting to null when absent.
entitlements?
Section titled “entitlements?”
optionalentitlements?:Record<string,boolean>
Feature entitlements granted by plan + entitlement rules.
optionalid?:string
Authenticated user identifier. When undefined, the SDK uses an anonymous ID.
personalization?
Section titled “personalization?”
optionalpersonalization?:SdkTraits
Transient personalization token map.
Holds SDK-derived tokens (plan_name, usage_current, etc.) merged with
app-provided tokens. Not persisted — rebuilt on each SDK session.
Widened to accept unknown at the SDK boundary; narrowed to
string | number when serialized.
usage?
Section titled “usage?”
optionalusage?:Record<string, { }>
Usage entries derived from credits / usage_limit entitlements, keyed by handle.