Web Widget
The web widget embeds the AI copilot directly in your application. Users interact with it through a floating panel, and the SDK handles context, identity, and tool execution in the browser.
Setup
Install the SDK and wrap your app with the provider. See Quickstart for full installation instructions.
import { PillarProvider } from '@pillar-ai/react';function App() {return (<PillarProvider agentSlug="your-agent-slug">{/* your app */}</PillarProvider>);}
Channel settings
These settings are configured in the dashboard under Agents > [your agent] > Channel Settings.
| Setting | Description | Default |
|---|---|---|
| Assistant Name | Display name shown in the panel header | Agent name |
| Welcome Message | First message shown when the panel opens | None |
| Input Placeholder | Placeholder text in the message input | "Ask a question..." |
| Open on Page Load | Automatically open the panel when the page loads | Off |
| Panel Position | Left or right side of the screen | Right |
| Panel Width | Width of the panel in pixels | 400 |
| Button Position | Corner placement of the floating button | Bottom right |
| Button Label | Text label on the floating button | None (icon only) |
Identity
Web widget users are identified through the identify() method in the SDK. Call it after your user logs in:
pillar.identify('user_7842', {email: 'sarah@acme.com',name: 'Sarah Chen',});
On logout, call pillar.logout() to clear the identity.
If your app uses API tool sources (OpenAPI), you can pass apiToken in identify() to forward the user's auth token — Pillar calls the APIs on their behalf without a separate OAuth step.
See Adding User Context for setContext, apiToken, and the full identify API.
Theming
The widget appearance can be customized to match your brand. See Theming & Branding for color, font, and layout options.
Next steps
- Quickstart — Full installation walkthrough
- Adding User Context — Identify users and pass context
- Theming & Branding — Customize the widget appearance
- Building Inline UI — Render custom components inside the panel