Embed the OpenRails chat widget on your website with JWT authentication and customization
The OpenRails chat widget is an embeddable component that allows your users to interact with a bot directly from your website. It uses JWT-based authentication for secure access and supports visual customization to match your branding.
Create a dedicated bot in your project with the model, system prompt, and data lakes configured for your external users. See Starting a Conversation for bot creation.
In the bot settings, navigate to the Widget tab and toggle Enable Widget Embedding to ON.
Set up JWT authentication to control widget access:
Add the domains where the widget will be embedded to the Allowed Origins list. This prevents unauthorized embedding on other sites.
Click Copy Embed Code to get the HTML snippet for your website.
Embedding the widget is simple — add a single script tag to your website pointing to your OpenRails instance. All configuration (bot settings, knowledge base, branding, authentication) is managed server-side in the OpenRails dashboard.
All customization is managed through the OpenRails dashboard under your bot's Chat Template settings:
| Setting | Description |
|---|---|
| Theme | Light or dark color scheme for the widget |
| Position | Where the widget appears on the page |
| Title | Custom heading displayed in the widget header |
| Welcome Message | Initial greeting shown when the widget opens |
| Brand Colors | Primary accent color to match your site's branding |
| Domain Whitelist | Approved domains where the widget is allowed to load |