Admin › Settings › Embed Widgets
- With a single script tag, provide AI chat on any web page.
Why You Need It
Use scenarios:
- Place an AI assistant in internal groupware to compose leave requests by chat
- Embed a FAQ chatbot on customer support pages
- Mount an operations support AI on the management console
Creating Widgets
1
Add widget
Click the + button to create a new widget.
2
Enter basic info
3
Edit design
Click the Design button to customize appearance (details below).
4
Activate
Set the toggle to Active in the widget list. Inactive widgets aren’t loaded externally.
Display Modes
How the widget appears on the host page — 6 modes supported.Bubble mode’s Bubble Open Style also supports 4 options:
popup / side-right / side-left / side-bottom. Start as Bubble and specify how to expand on click.Resizable Panel
Toggle on Resizable Panel in widget settings to let users adjust panel size.
Adjusted size is saved in localStorage per
widgetId, so previous size is restored when the user revisits the same site.
Detect panel size changes from the host page
Detect panel size changes from the host page
When panel size changes in Side modes, the following occurs:
- CSS variable updates:
--cloosphere-side-panel-width,--cloosphere-side-panel-height - Event published to host page:
cloosphere:side-resize(payload includeswidth/height)
Design Customization
Fine-tune widget appearance in the Design editor.- See changes immediately with real-time preview.
Layout
Icons
Presets: Chat, Sparkles, Message, Robot, Support (Headset), Help (Question), Bolt
Header
Colors
Theme Presets
12 theme presets to apply all colors at once. Light, Dark, Slate, Midnight, Ocean, Aurora, Sunset, Forest, Rose, Cyberpunk, Ember, Mono After picking a preset, individual colors can be further customized.Chat Settings
Feature Toggles
Embed Code
Once a widget is created, a script tag to embed in the host page is provided.data-* attributes:
Inline mode example
Inline mode example
Pre-authentication (SSO integration) example
Pre-authentication (SSO integration) example
JavaScript API
Control the widget via JavaScript in Bubble mode:open() / close() only work in Bubble mode. They’re ignored in Side, Inline, and Fullscreen modes since the widget is always visible.Authentication Methods
The widget authenticates users via one of three modes.- Pick the mode in the Auth tab of widget settings.
Login Mode (default)
Sign in directly with a Cloosphere account.
The sign-in screen auto-shows OAuth provider buttons (Google, Microsoft, etc.) configured in Cloosphere.
SSO Mode
Exchange the host site’s existing SSO token for a Cloosphere JWT. Use the existing auth system without a separate sign-in screen. Supported Providers:
SSO Settings:
Per-Provider additional settings
Per-Provider additional settings
Guest Mode
Non-signed-in users can use the widget with simple info entry (or auto). Suitable for unrestricted-audience scenarios like customer support chatbots. Guest Settings:Domain Allowlist
For security, restrict which domains can load the widget. Register allowed domain patterns in widget settings’allowed_domains:
UI Manipulation Bridge
The most powerful feature of the embed widget — the AI directly manipulates the host page DOM.- For example, when a user says “submit a leave request for today”, the AI can auto-fill the host page’s leave request form.
Available Tools
UI manipulation tools auto-attach to the agent, enabling:Security: Selector Allowlist
Restrict the HTML elements the AI can manipulate usingallowed_selectors in widget settings.
In production, explicitly restrict
allowed_selectors. The default ["*"] lets the AI manipulate any page element, which can cause unintended behavior.Limitations
Related Pages
Agents
Create and configure AI agents to connect to widgets
Flows
Connect flows for complex multi-step tasks
Guardrails
Safety rules applied to widget responses
Deployment Checklist
CLOOSPHERE_PUBLIC_URL environment variable used for widget callbacks