Basic Embed
Embed Variants
| Variant | URL | Use case |
|---|---|---|
| Full | /embed/SCENARIO_ID | Complete UI with login, results |
| Basic | /embed/basic/SCENARIO_ID | Conversation only |
| Minimal | /embed/minimal/SCENARIO_ID | Mic button only |
URL Parameters
Visual
| Param | Values | Example |
|---|---|---|
color | violet-500, blue-500, green-500 | ?color=violet-500 |
bg | white, black, hex | ?bg=black |
showPulse | true, false | ?showPulse=false |
hidePoweredBy | true, false | ?hidePoweredBy=true (Pro+) |
User
| Param | Type | Example |
|---|---|---|
userName | string | ?userName=John%20Doe |
userEmail | string | ?userEmail=john@example.com |
Behavior
| Param | Type | Example |
|---|---|---|
skipPrecheck | boolean | ?skipPrecheck=true |
autoStart | boolean | ?autoStart=true |
Event Handling
Listen for session events:| Event | When |
|---|---|
onStart | Conversation begins |
onStop | Conversation ends normally |
onTerminated | Unexpected end |
React Example
Responsive Container
Security
Verify origin
Verify origin
Always check
event.origin before processing messages.CSP headers
CSP headers
Content-Security-Policy: frame-src https://app.toughtongueai.com;HTTPS only
HTTPS only
Microphone requires HTTPS (localhost works for dev).
Troubleshooting
| Issue | Fix |
|---|---|
| Mic not working | Check HTTPS, browser permissions, allow="microphone" |
| Iframe blank | Verify scenario ID, check is_public=true |
| Events not firing | Check origin filter, ensure listener added before load |