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
- Open your project in Framer.
- In the left sidebar, click Project Settings (the gear icon).
- Select the Custom Code tab.
- Click Add Script if this is your first entry; otherwise click the + icon.
- Give the script a recognisable name (e.g. Agentkit Widget).
- Paste both generated script tags together into the Custom Code field. Keep the script URL and agent ID exactly as copied.
- Under placement, choose End of
<body>tag (Body End) — this is the recommended option for chat widgets. - Choose to load on All pages.
- Click Save.
- 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:
- Select a page in the Framer layers panel.
- Open Page Settings (right-hand panel).
- 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.websiteURL or your connected custom domain, whichever will host the widget. - The widget works on the default
*.framer.websiteURL 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
- Open the published URL in an incognito window.
- Look for the chat bubble.
- Click to open and send a test message.
Next Steps
- Customize appearance in Design settings
- Set up domain restrictions (add your Framer site domain)
- Add suggested messages