Skip to content
QwryAI
Documentation
Pages

Integrations

Add an AI agent to your Bubble app

Add your QwryAI agent to a Bubble app with the Website widget code and an HTML element

You can add your QwryAI agent to a Bubble.io app by pasting the Website widget code into an HTML element on your page. Once the code loads, a floating chat bubble appears in the bottom corner of the app and opens the chat when a user selects it. The chat bubble is included on every QwryAI plan.

Before you start

  • A QwryAI account with an AI agent. If you haven't built one yet, follow Build your first AI agent.
  • A Bubble app you can edit. You can test in Preview on Bubble's free plan; Bubble needs a paid plan to deploy the app live.

How to embed your AI agent

  1. Open your agent's Chat bubble

    In QwryAI, open the agent you want in your app, select Channels in the sidebar, then select Manage on the Chat bubble card.

    Channels › Chat bubble › Manage.
  2. Open Deploy and choose Website widget

    Select Deploy in the top-right corner of the Chat bubble editor, then select Website widget.

    Deploy lists every way to add your agent.
Website widget opens the Website bubble sheet.
  1. Copy the code

    On the Website bubble sheet, select Copy under Widget setup. The code already points to your agent, so paste it exactly as copied.

    Copy the code under Widget setup.
  2. Open your page in the Bubble editor

    Open your app in the Bubble editor, go to the Design tab, and pick the page that should show the chat bubble.

  3. Add an HTML element

    Under Visual Elements, drag HTML onto the page. Its size and position don't matter: the chat bubble always sits in the bottom corner of the screen.

  4. Paste the code
    • With the HTML element selected, open Properties and find Content.
    • Replace the placeholder in the HTML box with your QwryAI code.
    • Leave Display as iFrame off. In a frame, the chat bubble would be clipped to the element's box.

    The chat bubble shows on the canvas as soon as the code is pasted.

    The chat bubble appears on the canvas once the code is in.
The chat window open in the app's Preview.

Show the agent on every page of your app

The HTML element only loads the code on the page it sits on. To show the chat bubble on several pages, put the HTML element in a reusable element that every one of those pages uses, such as a shared header. Once the code has loaded, the chat bubble belongs to the page itself, not to the HTML element, so the element can be small and sit anywhere in the header.

Allow your bubbleapps.io address

If you turned on Specific domains in the Deploy sheet, list each host your app runs on, one per line, then select Save domains. For example (example values):

Example conversation
https://acme.bubbleapps.io
https://app.acme.com
List each address, one per line, then Save domains.

Enter hosts without a path; QwryAI won't save an address with one. One bubbleapps.io entry covers both the development version (/version-test) and the live version of your app, and a custom domain needs its own entry. An entry without https:// or http:// is saved as https://. See Channels.

Troubleshooting

The chat bubble doesn't appear in Preview or on the live app

Possible causes:

  • Specific domains is on and your app's host isn't listed. Your browser's developer console shows that the chat was blocked by the page's frame-ancestors policy.
  • The visitor's country is in Blocked countries under Guardrails › Country blocking.
  • Visibility is off on the Chat bubble's Overview tab.
  • Display as iFrame is on for the HTML element.

Solution: fix the matching setting and reload the app.

Frequently asked questions

Does hiding the HTML element hide the chat bubble?

Not once the code has run. The chat bubble is added to the page itself, outside the HTML element, so hiding or collapsing the element afterwards leaves it in place. Whether the code runs at all when the element starts hidden depends on how Bubble handles hidden elements.

Do I need separate setups for version-test and live?

No. Both versions use the same code. If you use Specific domains, one entry for your bubbleapps.io host covers both.

How does the chat behave for users on phones?

On screens narrower than 768px, the chat opens full screen until the user closes it. Its side of the screen comes from Position under Display › Floating bubble.

Position: Left or Right.
Can I pass the logged-in Bubble user to the agent?

Yes. The chat bubble supports identity verification: your app signs a token for the signed-in user and passes it to the chat bubble, so your agent knows who it's talking to. The Identity verification section of the Website bubble sheet has the secret key and the code.

Next steps

Explore the documentation