Documentation Index
Fetch the complete documentation index at: https://docs.teamai.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Our identity verification system allows you to:- Securely pass user information to chatbots
- Connect interactions to actual user accounts
- Track user history and interactions
How It Works
- Generate a secret key for your workspace in the TeamAI dashboard
- On your server, create an HMAC-SHA256 hash of a user’s ID using this secret
- Send the user ID and hash to your frontend
- Use the TeamAI SDK’s
identifymethod to verify the user
Obtaining the User Hash
The secret key is generated in the TeamAI dashboard under Settings > Identity Verification. Use this key to generate a hash on your server:Identity Method
Use theidentify method to verify user identity:
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | Unique identifier for the user |
| user_hash | string | Yes | Server-generated HMAC SHA-256 hash of the user_id |
| user_metadata | object | No | Additional user information (max 1000 characters total) |
user_metadata object can include any user attributes you want to make available to your chatbot, such as name, email, or custom fields.
Complete Example
This example shows how to implement identity verification in a real application:Security Considerations
- Never expose your verification secret key in client-side code
- Always generate the hash on your server
- Use HTTPS for all communication between your server and client
- The user_id should be a unique identifier that doesn’t change for each user
- Consider using a UUID or database ID rather than personally identifiable information
Troubleshooting
If identity verification fails:- Make sure you’re using the correct environment for your test (local vs production)
- Verify that the user ID in your hash generation matches the one you’re passing to
identify() - Check the browser console for any error messages from the SDK
- Enable debug mode by adding
?teamAIDebug=trueto your URL to see detailed logs