Website Widget

Deploy your AI agent on your website. Learn how to generate embed codes, customize appearance, and manage API keys for secure integration.

The website widget is how visitors interact with your AI agent. A small floating button opens a chat interface powered by your agent. You control the appearance, position, and behavior through the Config > Connections sub-tab.

Simple EmbedOne script tag, no dependencies
CustomizableMatch your brand colors and style
SecureAPI keys with origin restrictions

Find integrations in your agent's Connections tab under "Website Widget." Click + Create Integration.

1

Name Your Integration

Give it a descriptive name like "Production Website" or "Marketing Landing Pages." This helps you manage multiple integrations for different sites.

2

Configure Security

Optionally restrict the API key to specific origins. Only requests from listed domains will work.

3

Get Your Embed Code

Copy the generated script tag and paste it on your website. The widget appears immediately.

Important: Important: The API key is only shown once during creation. Copy it immediately. If you lose it, delete the integration and create a new one.

Choose the embed format that works best for your website.

Script Tag (Recommended)

Works on any website. Paste before the closing </body> tag.

HTML
<script
  src="https://simplyasking.io/widget/v2/agent.js"
  data-agent-id="YOUR_AGENT_ID"
  data-api-key="YOUR_API_KEY"
  data-theme="dark"
  data-position="bottom-right"
  async
></script>

How It Works

The widget uses Shadow DOM to render directly on your page. Your site's CSS won't affect the widget, and the widget's CSS won't affect your site. No iframe needed. Conversations persist across page navigations within the same browser session. After 30 minutes of inactivity, a new session starts automatically.

Customize appearance through data attributes or the branding panel in Chat Test.

Theme

Lightdata-theme="light"
Darkdata-theme="dark"
Autodata-theme="auto"

Position

Bottom Rightdata-position="bottom-right"
Bottom Leftdata-position="bottom-left"
Bottom Centerdata-position="bottom-center"

Branding Options

Primary Colordata-primary-color="#2F6244"
Accent Colordata-accent-color="#AD8F46"
Logo URLdata-logo="https://..."
Company Namedata-company="Acme Inc"

Each integration has its own API key. Manage keys from Config > Connections.

Key FormatWidget API keys start with wak_ followed by random characters.
Rate LimitingEach API key is rate-limited to 60 requests per minute. This prevents abuse while allowing normal user traffic.
Origin RestrictionsLock your API key to specific domains. Requests from other origins will be rejected. Leave empty to allow any origin (not recommended for production).
Last UsedThe integration list shows when each key was last used. Keys that haven't been used in a while may indicate old installations that need updating.
Pro Tip: Best practice: Create separate integrations for production, staging, and development. This lets you revoke dev keys without affecting production.

Auto-Open

Automatically open the chat widget after a delay.

None
3 seconds
5 seconds
10 seconds
Example
data-auto-open="5000"  // Opens after 5 seconds

Page Awareness

Send page context to the agent for more relevant responses.

OffNo page context sent
Route OnlySends current URL path
Full ContextSends page title and meta description

JavaScript API

Control the widget programmatically.

JavaScript
// Open the widget
window.SimplyAsking.open();

// Close the widget
window.SimplyAsking.close();

// Toggle open/close
window.SimplyAsking.toggle();

// Send a message programmatically
window.SimplyAsking.sendMessage("What are your business hours?");

// Listen for events
window.SimplyAsking.on('message', (msg) => {
  console.log('New message:', msg);
});
Widget doesn't appearVerify the agent is Active (not Draft or Paused). Check the script is placed before </body>. Confirm API key hasn't been deleted. Check browser console for errors (F12 → Console). If using origin restrictions, verify your domain is listed.
Widget appears but won't respondCheck LLM provider API key is configured in Config > Connections. Verify the LLM provider (OpenAI/Google) has credits. Test the agent in the Chat Test tab to isolate the issue. Check for rate limiting (60 requests/minute limit).
Styling conflictsThe widget uses Shadow DOM to isolate styles. If using CSP, add simplyasking.io to allowed scripts. Check for z-index conflicts with other fixed elements.
403 Origin Not AllowedYour domain isn't in the allowed origins list. Add your domain in the integration settings. Include both www and non-www versions if applicable. Remember to include protocol: https://
Was this helpful?