For developers
Embed the Loopwix chat in your site or app with one script tag, control it from code, and find where the developer docs live.
This page is for developers who need to put the Loopwix chat on a site or app and control it from their own code. Build and publish a working agent first, using a quickstart; the embed only shows what the agent already does.
How do I add the Loopwix chat to my site with code?
Publish your agent first, then paste the one script tag from the dashboard into your site or app. The widget talks to your published agent, so you host nothing and build no chat interface. After that, you can control the chat from your own page code.
What you embed
The website chat is a small widget loaded by one script tag. You do not host anything or build a chat interface. The widget talks to your published agent, and customers see the last published version.
Embed
- In the dashboard open your agent, then go to Channels, website chat, Install.
- Copy the one-line script. It includes your agent's public key, which is safe to put in a page.
- Paste it before the closing
</body>tag. - Add your site's address to Allowed sites in Advanced settings.
The chat only loads on sites you list there, including www. if your site uses it. If it does not appear, the allowed list is the first thing to check.
Control the chat from your page
- Add
data-loopwix-opento any button or link to open the chat. See Install the website chat. - The widget exposes
Loopwix.open(),Loopwix.close(),Loopwix.toggle()andLoopwix.on(event, fn). See JavaScript API.
Typical uses are a "Chat with us" link in a header or a help button that opens the chat from a pricing page.
Public key and allowed sites
The public key identifies your agent to the widget. It is not a secret, which is why it can appear in page source. Access is limited by Allowed sites and abuse protection, not by hiding the key. See Public keys and allowed sites.
Keep real secrets, such as API credentials, inside Integrations, where they are stored encrypted and never shown again.
Frameworks and security headers
- Using React or Next.js? See React and Next.js.
- A strict Content Security Policy or cookie rules? See CSP, cookies and privacy.
- Widget settings you can pass are in Widget options.
No-code alternative
If you cannot add a script, share the chat link instead. See Full page chat and the hosted page and public API.
Test before launch
- Embed on a staging site and add that address to Allowed sites.
- Open the chat on desktop and a phone.
- Run through the Go-live checklist.
- Before launch, make sure Allowed sites lists your real production address.
Learn more
- Developers covers embedding, options and keys.
- Webhooks and roadmap explains what is available now and what is planned.
- Advanced settings covers allowed sites and abuse protection.
Next steps
After your first Loopwix agent is live: improve its answers, add actions, connect more channels and invite your team to handle conversations.
For agencies
How an agency can use Loopwix for several clients: one workspace per client, team roles, and the Agency plan with more workspaces and people.