In the app: Agent Settings → Widget → Install → Install code. Switch on Show widget on my website in the same place.
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. ReplaceYOUR_TENANT_ID with your own.
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
Do I need to install a package in Lovable?
Do I need to install a package in Lovable?
No. The widget is one external script loaded from SmartAlex, so it adds no dependency and does not touch your bundle.
Do I have to redeploy when I change the widget look?
Do I have to redeploy when I change the widget look?
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.
Can I ask Lovable to add it for me?
Can I ask Lovable to add it for me?
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.Related
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.

