Overview
identify() links a user ID to a set of traits. Call it when a user signs up, logs in, or changes their plan. The scoring model uses traits like plan and mrr to contextualize risk.
You don’t need to call identify() before every event — identify once, then just track events.
Signature
Parameters
A stable, unique identifier for the user. Must be a non-empty string.
An object of user properties. All fields are optional but at least one is recommended.
An
AbortSignal to cancel the request. The SDK throws ChurnKitError with code ABORTED if the signal fires.UserTraits
| Field | Type | Description |
|---|---|---|
plan | string | Pricing plan ('free', 'pro', 'enterprise') |
mrr | number | Monthly recurring revenue in cents (e.g. 4900 = $49) |
email | string | User’s email address |
name | string | User’s display name |
company | string | Company name |
signedUpAt | string | ISO 8601 timestamp of signup |
[key] | string | number | boolean | null | Any custom trait |
Examples
Basic identification
On login
Plan upgrade
Custom traits
With abort signal
Return value
Errors
| Code | When |
|---|---|
VALIDATION_ERROR | userId is empty or not a string |
UNAUTHORIZED | API key is invalid or revoked |
TIMEOUT | Request exceeded timeout ms |
ABORTED | AbortSignal fired |