Customer identity
Identify customers
Connect messages, telemetry, and feature flags to the person using your app.
Why identity matters
BTX uses one stable customer identifier across support conversations, app activity, targeted flags, and unread message state. Your team gets one continuous customer history instead of an anonymous profile for every session.
Identify a customer
Identify after authentication state is ready. Name, email, and phone are optional, but including known profile fields helps your team recognize the customer. Normalize phone numbers to E.164 before passing them to BTX.
import BTXClientKit
BTX.identify(
BTXCustomer(
externalID: currentUser.id,
name: currentUser.name,
email: currentUser.email,
phone: currentUser.phoneE164
)
)Keep the identifier stable
Use the same customer ID on every device and after every sign-in.
- Use your canonical customer or account ID.
- Identify only after the app session is ready.
- Send profile fields only when they are already available.
- Keep server credentials out of the client application.
When to call identify
- 01
After sign-in
Identify as soon as your app has the canonical customer record.
- 02
When restoring a session
Identify again when the app restores an authenticated session.
- 03
When the account changes
Replace the previous identity before sending more customer activity.
Clear identity on sign-out
Clear the current customer when the app signs out or returns to an anonymous state. This prevents later activity from being attached to the wrong person.
BTX.identify(nil)