Documentation Index
Fetch the complete documentation index at: https://docs.humanizing.com/llms.txt
Use this file to discover all available pages before exploring further.
Getting Your Embed Code
The embed code is available from your agents deployment page in the Cosmo dashboard.Basic Embedding
Add the following script to your website, typically just before the closing body tag:Embedding Methods
Method 1: Script Tag (Recommended)
The simplest method - works with any website:Method 2: Dynamic Loading
Load the widget after page load for better performance:Configuration Options
Configure the widget behavior using data attributes:| Attribute | Type | Description |
|---|---|---|
| data-agent-id | string | Required. Your agent ID from the dashboard |
| data-position | string | Widget position: bottom-right (default), bottom-left |
| data-open-on-load | boolean | Auto-open widget when page loads |
| data-hide-button | boolean | Hide the floating chat button |
Page and Custom Context
The widget can send page context and custom values with each chat request. Use this when one agent should adapt to the page, location, department, or campaign where it is embedded. The embed script automatically provides these prompt placeholders:| Placeholder | Description |
|---|---|
{{ page_url }} | Current page URL without query string or hash |
{{ page_origin }} | Current site origin |
{{ page_path }} | Current path on the site |
https://example.com/products/widget?utm_source=newsletter#details, {{ page_url }} is https://example.com/products/widget, {{ page_origin }} is https://example.com, and {{ page_path }} is /products/widget.
To pass your own values, add a context object to humanizing.init:
Widget Context Guide
Learn where to add prompt placeholders, which built-in values are available, and how custom context is validated.
Verifying Your Installation
After adding the embed code:- Clear your cache - Ensure you are seeing the latest version of your site
- Look for the chat button - A floating button should appear in the corner
- Click to open - The chat interface should open smoothly
- Test a conversation - Send a test message to verify the connection
Troubleshooting
Widget not appearing
Widget not appearing
- Verify the agent ID is correct
- Check that your agent is deployed (not in draft mode)
- Ensure no JavaScript errors in the console
- Check for CSS conflicts with z-index
CORS or network errors
CORS or network errors
- Verify your domain is allowed in agent settings
- Check that your site uses HTTPS
- Ensure no ad blockers are interfering
Mobile display issues
Mobile display issues
- The widget is designed to be responsive
- Avatar panel is hidden on mobile (expected behavior)
- Check viewport meta tag is present
Copy button not working
Copy button not working
Security Considerations
The widget only works on domains you have authorized in your agent settings. Unauthorized domains will see a connection error.
- Always use HTTPS on your website
- Keep your agent ID confidential (though it is visible in page source)
- Configure allowed domains in the dashboard
Next Steps
User Features
Learn about features available to your visitors.
Widget Settings
Configure welcome messages and questions.
Styling
Customize the widget appearance.
Analytics
Track widget usage and conversations.