# Bubble

Add your AI agent to a Bubble app with the website widget code and an HTML element

## Overview

To add your AI agent to a Bubble app, copy the website widget code from QwryAI and paste it into an HTML element on your page. The chat bubble appears in the corner of that page.

### What you can do

Answer visitors' questions on your Bubble site from a chat bubble, without them leaving the page.

## Before you start

- A QwryAI account with an AI agent
- A Bubble app you can edit. You can test in Preview on Bubble's free plan; a paid plan is needed to deploy the app live.

## How to add your AI agent to Bubble

#### 1. Copy your embed code

1. In QwryAI, open the AI agent you want on your site.
2. Click Channels in the sidebar, then click Manage on the Chat bubble card.
3. Click Deploy and choose Website widget.
4. Under Widget setup, click Copy. The code already points to your agent, so paste it exactly as copied.

![The Website bubble panel in QwryAI with the widget code and its Copy button](/docs/screenshots/original/qwryai-deploy-website-widget.png)

Deploy → Website widget shows your agent's code, ready to copy.

#### 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-right corner.

#### 4. Paste the code and preview

1. With the HTML element selected, open Properties → Content.
2. Replace the placeholder in the HTML box with your QwryAI code. Leave Display as iFrame off.
3. Click Preview to open your app with the chat bubble.

![Bubble editor with an HTML element selected, the QwryAI code in its HTML box, and the chat bubble showing on the canvas](/docs/screenshots/original/qwryai-bubble-html-element.png)

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

> The chat bubble shows only on pages that have this HTML element. To show it on every page, put the element in a reusable element that all your pages use, such as a header.

## Check it works

Open your published Bubble site in a new browser window, open the chat bubble, and ask a question your agent should know. The conversation appears in your QwryAI Inbox.

![A Bubble app in Preview with the QwryAI chat window open and its greeting](/docs/screenshots/original/qwryai-bubble-live.png)

The chat window open in the app's Preview.

> **Specific domains**: If Specific domains is on in the same Deploy panel, your site's address must be on its list. Add it, for example *.bubbleapps.io, and click Save domains.

> To change the chat bubble's colors, text, and position, open Channels → Chat bubble → Display in QwryAI. Your site picks up the changes without new code.

## Next steps

- [Channels: customize the chat bubble](/docs/user-guides/agent-management/channels)
- [Website platforms: every way to add QwryAI to a site](/docs/user-guides/integrations/website-platforms)
