Overview
An overview of the Assistant API and the embeddable widget integration.
What is this?
The Assistant platform provides an API for building conversation-driven assistants and an embeddable widget that can be placed on websites. The typical architecture separates secret-bearing server code from browser code by issuing short-lived widget tokens.
The Companin Widget is more than just a chat interface—it's a complete conversational AI platform that seamlessly integrates into your website. Built with modern web technologies (Next.js, React, TypeScript), it provides enterprise-grade reliability while maintaining simplicity for developers.
Unlike traditional chat widgets that require complex backend setup, Companin handles all the infrastructure for you. Authentication, message storage, conversation management, and AI processing are all managed through our secure API, allowing you to focus on creating great user experiences.
Core Concepts
Understanding these core concepts will help you make the most of the Companin Widget:
- Assistant: a configured conversational agent.
- Session: a temporary context for a visitor interacting with an assistant.
- Widget token: short-lived JWT for authenticating widgets in browsers.
- Auth: JWTs or API key pair headers (X-API-Key + X-API-Secret).
💡 Key Insight
The widget configuration acts as the single source of truth for all appearance and behavior settings. This means you can update your widget's look and feel without changing any code on your website—just update the configuration in your dashboard and changes take effect immediately.
How it works (high level)
- Server holds client secret and exchanges it for a short-lived widget token via /api/auth/widget-token.
- Browser receives token and initializes the widget; widget uses the token to call API endpoints.
- Server-side endpoints accept JWTs or API key header pairs and apply organization-level rate limits.
Next steps
Follow the Quickstart to embed the widget, then consult the API Reference for details.