Skip to main content

identify

The identify method lets you tie a user to their actions and record traits about them.

Usage​

await client.identify(user_id, traits)

Parameters​

NameTypeDescription
user_idstrUnique identifier for the user (e.g., database ID).
traitsDict[str, Any]Dictionary of attributes associated with the user.

Traits​

The OpenCDP recognizes some special traits that are standardized across the platform:

  • email: User's email address.
  • first_name / firstName: User's given name.
  • last_name / lastName: User's family name.
  • phone: User's phone number.
  • created_at: The ISO-8601 timestamp representing when the user was created.

Example​

await client.identify("u_001", {
"email": "[email protected]",
"first_name": "Antigravity",
"tier": "enterprise"
})

Dual-Write Behavior​

If send_to_customer_io is enabled in the configuration, this method will also call the Customer.io identify API.