Skip to content
Identify customers

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.

01

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.

Authenticated session
import BTXClientKit

BTX.identify(
    BTXCustomer(
        externalID: currentUser.id,
        name: currentUser.name,
        email: currentUser.email,
        phone: currentUser.phoneE164
    )
)
02

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.
03

When to call identify

  1. 01

    After sign-in

    Identify as soon as your app has the canonical customer record.

  2. 02

    When restoring a session

    Identify again when the app restores an authenticated session.

  3. 03

    When the account changes

    Replace the previous identity before sending more customer activity.

04

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.

Sign out
BTX.identify(nil)