Skip to main content
A Lovable app gets a voice in two steps: build the agent in SmartAlex, then add the widget to your project. The widget is one external script, loaded from a React component in your root layout.
In the app: Agent Settings → Widget → Install → Install code. Switch on Show widget on my website in the same place.
The diagram shows the steps.
1

Build the agent

In the app, fill in the Create a new agent card on Home with your website address or two lines about your business. Then click Create agent. Or connect an AI app over MCP and ask it to create the agent and fetch the widget code.
2

Pick a widget style

Open Agent Settings → Widget. Widget v2 gives voice and chat in one window and suits most sites. Voice pill is a voice-only button. See Widgets for all five styles.
3

Copy the Install code

Open Install → Install code and press Copy. It has your data-tenant-id filled in.
4

Paste it into Lovable

Use the component or the script tag below.
5

Turn it on

Switch on Show widget on my website under Agent Settings → Widget.

How do I paste it into Lovable?

Lovable makes a React app, so use the component. Replace YOUR_TENANT_ID with your own.
Paste the component into Lovable. Then tell the builder: “Add this script to the root layout inside a useEffect and clean it up on unmount.”

Does the widget update without a redeploy?

Yes. The widget reads its style, colours and agent from SmartAlex when the page loads. Change them in Agent Settings → Widget and the live site updates on the next load. The same component works in any React or Next.js app, while static and CMS sites use the script tag, as in the widget install guide.

Questions people ask

No. The widget is one external script loaded from SmartAlex, so it adds no dependency and does not touch your bundle.
No. The widget reads its style, colours and agent from SmartAlex each time the page loads. Change them in Agent Settings → Widget, and the live site updates on the next load.
Yes. Paste the component into the chat and ask Lovable to add it to the root layout inside a useEffect and clean it up on unmount.

Widgets

Styles, colours, callbacks and limits.

Installing the widget

Guides for other sites and fixes for a widget that does not show.

Cursor, v0 and Bolt

The same widget in other AI builders.

Claude Code

Create and manage agents over MCP.
Last modified on November 27, 2026