Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt

Use this file to discover all available pages before exploring further.

Stores structured attributes for the current user to power offer targeting, personalization, and analytics. Attributes are merged with existing attributes—they do not replace them entirely.

Signature

public func setUserAttributes(
  _ attributes: UserAttributes
)
Attributes are merged, not replaced. If you set email and subscriptionTier, then later set monthsSubscribed, all three attributes will be preserved.

Parameters

NameTypeDescription
attributesUserAttributesStructured attributes object containing user metadata for targeting and analytics. See UserAttributes for all available fields.

Usage

Basic attributes

Encore.shared.setUserAttributes(
  UserAttributes(
    email: "user@example.com",
    subscriptionTier: "premium",
    monthsSubscribed: "6"
  )
)