Embedding the dashboard is available to enterprise customers with reseller API access. Contact us to get started.
Overview
The embed system works in three steps:1
Create a user
Use the Users API to create a user - this returns an
embed_token2
Manage embed tokens
Use the dedicated endpoints to get current token or generate new ones
3
Embed the dashboard
Use the token in your frontend to embed the dashboard
Getting Embed Tokens
From User Creation
When you create a user, the response includes anembed_token:
Managing Existing Tokens
For existing users, you can retrieve or regenerate embed tokens using dedicated endpoints:Get Current Embed Token
Generate New Embed Token
Embedding the Dashboard
There are two ways to embed the Answering Agent dashboard:- Iframe Embed (Recommended) - Simple, isolated, no JavaScript needed
- Script Embed - More control, direct DOM integration
Iframe Embed (Recommended)
The easiest way to embed the dashboard with complete DOM isolation:- ✅ Zero JavaScript required - just paste the iframe
- ✅ Complete DOM isolation from your page
- ✅ Works with strict Content Security Policies
- ✅ No conflicts with your site’s CSS or JavaScript
- ✅ Easy to implement in any CMS or page builder
Script Embed
For more direct integration into your page’s DOM:Quick Start Checklist
For Iframe Embed:- ✅ Iframe tag with
srcpointing to/dashboard.html?token=YOUR_TOKEN - ✅ Valid embed token in the URL query parameter
- ✅ Container div with
id="answering-agent" - ✅ Embed token in
data-tokenattribute - ✅ Embed script loaded from
https://answeringagent.com/embed.js - ✅ API URL in
data-api-urlattribute (optional, for playground/custom environments)
data-token and handles all other configuration.
Dynamic Token Management
For production applications, you should dynamically fetch and inject tokens:React Component Example
Security Features
Compact Tokens
- URL-safe base64 encoding without padding
- Optimized for query parameters and data attributes
Secure Validation
- Uses HMAC-SHA256 for cryptographic integrity
- Tokens are tied to specific users and cannot be transferred
- Automatic signing secret rotation invalidates old tokens
Token Lifecycle
- Tokens don’t expire but can be invalidated by generating new ones
- Each user can only have one valid token at a time
- Signing secrets are unique per user and automatically generated
Error Handling
Invalid or Expired Tokens
If an embed token is invalid, the embedded dashboard will show an authentication error. Common causes:- Token was invalidated by generating a new one
- Token is malformed or corrupted
- User account was deleted or suspended
Missing Configuration
If the required window settings are not properly configured, you may see:- Console warnings about missing
answeringAgentSettings - Dashboard not loading or appearing blank
- Authentication errors
Best Practices
- Proxy through your backend - Don’t expose your API key in frontend code
- Store tokens securely in your database associated with user accounts
- Use unique embed IDs - Each embed instance should have a unique
idin the settings - Set configuration before script load - Always configure
window.isAnsweringAgentEmbeddedandwindow.answeringAgentSettingsbefore loading the embed script - Regenerate tokens when users change passwords or for security rotations
- Handle errors gracefully with fallback UI when embedding fails
- Use HTTPS for all communication with embed tokens
- Monitor usage and regenerate tokens if you suspect compromise
Troubleshooting
Dashboard Won’t Load
- Verify the embed token is valid using the validation endpoint
- Confirm the container has
id="answering-agent"(exact match required) - Check browser console for JavaScript errors
- Ensure the embed container has proper dimensions and is visible
Authentication Errors
- The token may have been invalidated - generate a new one
- Check that the token matches the user making the request
- Verify your API key has proper permissions for the user
- Ensure the
data-tokenattribute is set on the container
Configuration Errors
- Verify the container has exactly
id="answering-agent" - Check that the
data-tokenattribute contains a valid embed token - Ensure the embed script loads successfully from
https://answeringagent.com/embed.js - Monitor network requests to verify API calls are reaching the correct endpoint
Performance Issues
- Cache embed tokens in your backend to avoid repeated API calls
- Consider preloading the embed script on pages where it will be used
- Monitor embed container sizing to prevent layout shifts