Skip to main content

Framework-specific setup

Add the snippet before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
  <title>My Site</title>
</head>
<body>
  <!-- Your page content -->

  <anam-agent-widget agent-id="your-persona-id"></anam-agent-widget>
  <script src="https://unpkg.com/@anam-ai/agent-widget" async></script>
</body>
</html>
For specific website builder guides such as WordPress and Shopify, see the Widget cookbook.

Domain allowlisting

The widget will not create sessions unless your domain is allowlisted. Without this step, users will see an “Origin not allowed” error when they try to start a conversation.
To allowlist your domain:
  1. Open Anam Lab and navigate to your persona
  2. Go to the Widget tab
  3. Under Allowed domains, add your website origin (e.g., https://example.com)
  4. Click Publish
You can add multiple domains (e.g., production, staging, localhost for development). Alternatively, enable Allow everywhere to skip domain restrictions entirely.
For local development, add http://localhost:3000 (or your dev server port) to the allowed domains list.