We store phone numbers in E.164 (+4915168433056), but allow common variations such as +49 30 12345678 or +1 (415) 555-2671 for the input
Annotate Users
Arbitrary Data
You can also annotate custom values with theexternal_attributes JSON. By default we merge external attributes, keeping unset values, to deactivate merging the top level keywords set merge_external_attributes to false
Session Continuity
A session allows users to retrieve their past conversations. By default, botBrains enables session continuity within the same browser and all subdomains. This means botBrains will still identify a user who goes to your landing page onwww.acme.com and then signs into app.acme.com as the same user.
You can opt-in to cross device session continuity by manually the user via the user.identify action in the SDK.
User Identification
user_01234567890 key here is what we call the external_id of a user. Two users with the same external_id will be able to reach each others conversations.
🚨 Security 🚨 - READ THIS
Since we allow you to explicitly set if users are the same or different and thus retrieve sensitive information such as past conversations, we need to be careful in choosing theexternal_id. You have two options:
- User-Specific Secret Generate a random id, store it with your user, and send it to your frontend. Don’t use or leak this anywhere.
- Verified User ID (✅ Recommended) Possibly known ID that’s added with a signature of a shared secret of your back end and the botBrains Platform.
User-Specific Secret
You associate your user with a unique identifier (e. g. UUID) that other users should never know. Your app commonly leaks User Ids when it supports Teams, Collaborates, Share Links, and other features, so youruser_id is usually a bad choice.
Insecure External Ids are:
- timestamps
- phone
- serial identifiers (e. g. user id 38992)
- any text shorter than 16 characters (the system rejects these)
- UUIDs
- anything with large entropy
Verified User Id
Alternatively, we suggest you use user verification. User Verification works by signing the values you pass to the SDK on a back-end server and passing it through your frontend into the Web SDK. The signature is the HMAC, that’s the hash of your user identifier and a shared secret known to your back-end servers and the botBrains platform.- We will share the verification secret with you on request, this is currently not expose through our platform
Python
Python
JavaScript Node
JavaScript Node
PHP
PHP
user.identify with external_id_signature. Note that we expect the hex-encoded version of the resulting 32 bytes of HMAC, totaling 64 characters.
Verifying email and phone
You can also verify the email and phone of a user, using the same HMAC procedure shown above, just using theemail and phone values instead of the user_id.
Python
Python