Skip to main content

Framework-specific setup

Add the snippet before the closing </body> tag:
For specific website builder guides, see our integration pages for Shopify, WordPress, Wix, and Squarespace, or browse all widget cookbooks.

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 your persona in the Anam Lab editor.
  2. Select Embed and choose Widget.
  3. Under Allowed Domains, enter your website origin (e.g., https://example.com) and select the + button.
  4. Select Publish before testing the embed.
These persona settings apply to both Widget and Iframe embeds. To configure an iframe, choose Iframe in the Embed tab and use the same Allowed Domains controls. Enter an HTTP or HTTPS origin: a scheme, hostname, and port when needed. Lab assumes https:// if you omit the scheme and removes paths, query strings, and fragments. For example, https://example.com/store is saved as https://example.com. Origins are matched exactly, ignoring case. Add https://example.com and https://www.example.com separately; allowing one does not allow the other or any other subdomain. HTTP and HTTPS origins differ, as do different non-default ports. Wildcard patterns do not match subdomains. Add each production, staging, or development origin you need. Alternatively, enable Allow everywhere to allow embeds on any domain. Only use this if unrestricted embedding is intentional. These are persona embed settings, not the separate origin restrictions on share-link embeds. Changing Allowed Domains here does not update an existing share link.
For local development, add http://localhost:3000 (or your dev server port) to the allowed domains list.
Last modified on September 16, 2026