Framer

Add your agent to a Framer site using Custom Code.

Add your AI agent to a Framer site via Custom Code. The snippet loads on every page once published.

In Agentkit, open Channels → Website embed → Chat widget, enable the channel, and copy the complete generated code. It contains an inline bootstrap and a separate widget loader.

Quick Setup

  1. Open your project in Framer.
  2. In the left sidebar, click Project Settings (the gear icon).
  3. Select the Custom Code tab.
  4. Click Add Script if this is your first entry; otherwise click the + icon.
  5. Give the script a recognisable name (e.g. Agentkit Widget).
  6. Paste both generated script tags together into the Custom Code field. Keep the script URL and agent ID exactly as copied.
  7. Under placement, choose End of <body> tag (Body End) — this is the recommended option for chat widgets.
  8. Choose to load on All pages.
  9. Click Save.
  10. Click Publish in the top-right to push the update live.

Do not use a single-tag example or type your own widget URL. After publishing, check the page source for both generated <script> tags, then open the widget and send a test message. JavaScript widget guide →

Why End of <body>, not Head

Framer separates Custom Code into Head Code and End of <body> Code. Chat widgets should go at the end of <body> so they don't delay the first paint of the page — this also matches the async attribute on the script.

Head Code is reserved for things that must run very early, like analytics pixels or font preloads.

Page-Specific Install

To load the widget on specific pages only:

  1. Select a page in the Framer layers panel.
  2. Open Page Settings (right-hand panel).
  3. Add Custom Code there instead of in Project Settings.

Page-level code only runs on that specific page.

Plans & Domains

  • Framer requires a paid plan for a custom domain. Test the published *.framer.website URL or your connected custom domain, whichever will host the widget.
  • The widget works on the default *.framer.website URL if your plan allows Custom Code there.

After Publishing

Framer Custom Code does not run inside the editor or preview — only on the published site. After hitting Save, click Publish and then open the live URL.

Troubleshooting

Widget doesn't appear in the editor preview.

  • Expected. Custom Code only runs on the published site.

Widget doesn't appear on the published site either.

  • Confirm you clicked both Save and Publish.
  • Check the domain restrictions for your published Framer domain.
  • Hard-refresh (⌘+Shift+R) to bypass CDN cache.

Widget flashes then disappears.

  • Check for Framer's page transitions or animations that may reload the DOM. The widget should re-mount on each page load — if it doesn't, contact support.

Testing

  1. Open the published URL in an incognito window.
  2. Look for the chat bubble.
  3. Click to open and send a test message.

Next Steps