Embeddable Widget

Last updated: March 24, 2026

A rules assistant on your site in 5 minutes

The widget is a standalone rules chat interface that you embed on your own website. Your players get instant answers to rules questions without leaving your page.

Loading diagram...

The widget communicates with the orchestrator through a dedicated /api/widget/* endpoint that handles session management and partner attribution.

Three integration methods

<script src="https://boardgamelibrarian.ai/widget.js"></script>
<script>
  BoardGameLibrarian.init({
    partnerId: 'YOUR_PARTNER_ID',
    gameId: 12345,
    container: '#bgl-widget',
  });
</script>
<div id="bgl-widget"></div>

This is the simplest integration. One script tag, one init call, one container element.

Method 2: iframe

<iframe
  src="https://boardgamelibrarian.ai/embed?partnerId=YOUR_ID&gameId=12345"
  width="100%" height="600"
  frameborder="0">
</iframe>

Fully isolated -- no JavaScript dependency on your page.

Method 3: React component

import { BGLWidget } from '@boardgamelibrarian/react';

export function RulesPage() {
  return <BGLWidget partnerId="YOUR_ID" gameId={12345} />;
}

Available via npm for React-based sites.

Transparent mode

If you want the widget to match your site color scheme, set transparent: true in the init options. The widget background becomes transparent and inherits your page CSS.

Session handling

The widget reuses sessions by partner + IP combination. A player who closes and reopens the widget within the same session window gets their conversation history back.

Analytics

Every question asked through your widget is tracked in the partner portal -- game coverage, response confidence, player satisfaction. See the Partner Portal article for details.