User Identification
Identify users in your app for personalized experiences.
User Identification
Identifying users is how you connect the people using your app to the targeting and personalization features in Setgreet. Once a user is identified, you can target them with flows based on their attributes, personalize content with their data, and track their behavior across sessions.
The identifyUser call
The identifyUser method sets the current user's ID and optional attributes. Call it whenever you know who the user is -- typically after login or signup.
// iOS
Setgreet.identifyUser(userId: "user_123", attributes: [
"email": "jane@acme.com",
"plan": "pro",
"signupDate": "2026-01-15"
])// Android
Setgreet.identifyUser("user_123", mapOf(
"email" to "jane@acme.com",
"plan" to "pro",
"signupDate" to "2026-01-15"
))// React Native
import { identifyUser } from '@setgreet/react-native-sdk';
identifyUser('user_123', {
email: 'jane@acme.com',
plan: 'pro',
signupDate: '2026-01-15',
});// Flutter
await Setgreet.identifyUser(
userId: "user_123",
attributes: {
"email": "jane@acme.com",
"plan": "pro",
"signupDate": "2026-01-15",
},
);The userId should be a stable, unique identifier from your system -- the same ID you use in your database or authentication provider. Do not use ephemeral identifiers like session tokens.
Anonymous users
Before identifyUser is called, the SDK assigns an auto-generated anonymous ID to the device. This allows Setgreet to:
- Display flows that do not require user targeting (for example, a generic welcome screen).
- Track flow analytics for unidentified users.
- Associate pre-identification behavior with the user once
identifyUseris called.
The anonymous ID is a UUID stored on the device and persists across app launches until resetUser is called.
Some platforms expose the anonymous ID if you need it for server-side correlation. For example, in Flutter:
final anonId = await Setgreet.anonymousId;Updating attributes
You can call identifyUser multiple times with the same userId to update attributes. Each call merges the new attributes with the existing ones -- it does not replace the full set.
// Update a single attribute after a plan change
Setgreet.identifyUser(userId: "user_123", attributes: [
"plan": "enterprise"
])This is useful for keeping Setgreet in sync when user properties change mid-session (for example, after a plan upgrade or a profile update).
Reset
Call resetUser when the user logs out. This clears the identified user and generates a new anonymous ID.
// iOS
Setgreet.resetUser()// Android
Setgreet.resetUser()// React Native
import { resetUser } from '@setgreet/react-native-sdk';
resetUser();// Flutter
Setgreet.resetUser();After resetUser, the SDK behaves as if it is a fresh, unidentified device. Call identifyUser again when the next user logs in.
Always call resetUser on logout. If you skip this step and a second user logs in on the same device, flows may be
shown based on the previous user's attributes.
When to identify
| Moment | Why |
|---|---|
| After login | The most common place. You know the user ID and can pass current attributes. |
| After signup | Identify the user immediately after account creation so onboarding flows can be personalized. |
| When attributes change | Call identifyUser again with updated attributes so trigger conditions and variable bindings reflect the latest data. |
| On app launch (if already authenticated) | If the user is still logged in from a previous session, re-identify on launch to ensure the SDK has fresh attributes. |
What counts as an MAU
Each unique userId (or anonymous ID if the user is not identified) that triggers at least one SDK request during a billing period counts as one Monthly Active User (MAU) for billing purposes. Calling identifyUser itself does not consume additional MAU -- the user is counted once per billing period regardless of how many times identifyUser is called.