Customer identity
Identify Flutter customers
Connect Flutter telemetry, feature flags, customer messages, and knowledge base activity to one stable customer identity.
Use the identity your app already trusts
BtxCustomer.externalId is the required customer key. Name and email are
optional profile fields that help your team recognize the customer.
Identify after authentication
Identify as soon as the host app has restored or created an authenticated session. The same identity is shared by telemetry, feature flags, messages, the knowledge base, and push registration.
await Btx.identify(
const BtxCustomer(
externalId: 'customer_123',
name: 'Taylor',
email: 'taylor@example.com',
),
);Keep identity transitions ordered
The facade serializes configure and identity work. Btx.ready() is available
when host code needs an explicit boundary before reading state or continuing a
dependent flow.
await Btx.configure(configuration);
await Btx.identify(
BtxCustomer(
externalId: session.user.id,
name: session.user.name,
email: session.user.email,
),
);
await Btx.ready();- Use the same external ID on every device and after every sign-in.
- Call identify again when the signed-in account changes.
- Send optional name and email only when the host already has them.
- Do not recreate lower-level SDK controllers for routine profile refreshes.
Clear identity on sign-out
Clear the customer before later app activity can be attributed to the signed-out account. BTX stops customer-scoped messaging work and cleans up stale push bindings when the identity changes or is cleared.
await Btx.identify(null);