Frontend Integration Overview
This guide covers how to integrate Ozwell's AI chat interface into your website or web application. All frontend integrations use scoped API keys that are restricted to specific agents and their assigned permissions, making them safe for client-side use.
Integration Approachesβ
Quick Comparisonβ
| Method | Setup Time | Build Required | Best For |
|---|---|---|---|
| CDN Embed | ~5 min | No | Static sites, quick prototypes |
| Framework | ~15 min | Yes | Production SPAs |
| Iframe | ~10 min | Optional | Custom implementations |
CDN Embed (Fastest)β
Add Ozwell to any website with a single script tag. No build step required.
<script
src="https://cdn.ozwell.ai/embed.js"
data-api-key="your-scoped-api-key"
data-agent-id="your-agent-id"
></script>
β‘οΈ Full CDN documentation
Framework Integrationβ
For production applications using modern JavaScript frameworks, we provide dedicated integration guides:
| Framework | Guide | Status |
|---|---|---|
| React | React Integration | β |
| Next.js | Next.js Integration | β |
| Vue 3 | Vue 3 Integration | β |
| Vue 2 | Vue 2 Integration | β |
| Svelte | Svelte Integration | β |
| Vanilla JS | Vanilla JS Integration | β |
All framework integrations render Ozwell within an isolated iframe, ensuring:
- π Security isolation from your host page
- π¨ Consistent styling that won't conflict with your CSS
- π± Responsive behavior out of the box
Security Modelβ
Privacy Firstβ
Ozwell is built on a foundation of user privacy and control. When a user opens Ozwell, their conversation is privateβthe host site cannot see, intercept, or log what is said. This creates a safe space where users can:
- Ask any question without embarrassment
- Explore topics freely without surveillance
- Trust that their dialogue stays between them and Ozwell
Sharing is always opt-in. Only when a user explicitly chooses to share information does it become visible to the host site.
Scoped API Keysβ
Frontend integrations use scoped API keys which are:
- β Agent-specific: Tied to a single agent configuration
- β Permission-limited: Only allows operations the agent is authorized for
- β Rate-limited: Protected against abuse
- β Revocable: Can be rotated or disabled without affecting other keys
Iframe Isolationβ
All frontend integrations run inside an iframe with:
- Sandboxed execution β No access to parent page DOM
- Origin isolation β Separate security context
- CSP compliance β Strict content security policies
- No message relay β Conversation content stays in the iframe
- User-controlled sharing β Only explicit user actions can share data
β‘οΈ Learn more about iframe security
Customization Optionsβ
Appearanceβ
| Option | Description | Default |
|---|---|---|
theme | Light or dark mode | auto |
primaryColor | Accent color for buttons/links | #4f46e5 |
position | Widget position (bottom-right, bottom-left, etc.) | bottom-right |
width | Chat window width | 400px |
height | Chat window height | 600px |
Behaviorβ
| Option | Description | Default |
|---|---|---|
autoOpen | Open chat on page load | false |
greeting | Initial message to display | Agent's default |
placeholder | Input field placeholder text | "Type a message..." |
Privacy by Designβ
The conversation between Ozwell and the user is private by default.
Why Privacy Mattersβ
- No message relay: Conversation content is never sent to the host site
- Safe space: Users can ask any question without fear of judgment or surveillance
- User control: Only the user decides if and when to share conversation details
- Trust: The Ozwell brand stands for privacy and user empowerment
What the Host Site Can Seeβ
The host site receives only lifecycle events, never message content:
// β
Allowed: Lifecycle events (no content)
window.addEventListener('ozwell:ready', () => {
console.log('Ozwell widget loaded');
});
window.addEventListener('ozwell:open', () => {
console.log('Chat opened');
});
window.addEventListener('ozwell:close', () => {
console.log('Chat closed');
});
// β Not available: Message content is private
// window.addEventListener('ozwell:message', ...) β Does not exist
User-Initiated Sharingβ
If the user explicitly chooses to share information with the host site, they can do so through in-chat actions:
// Only triggered when user clicks "Share with site" in chat
window.addEventListener('ozwell:user-share', (event) => {
// User explicitly consented to share this specific data
console.log('User shared:', event.detail);
});
This ensures users always feel comfortable asking questionsβeven ones they might consider "dumb"βknowing the conversation stays between them and Ozwell.
Next Stepsβ
- Quick start: Try the CDN embed first
- Production app: Follow your framework guide above
- Custom needs: Review iframe integration
- Security deep-dive: Understand the iframe security model