🔑 License Keys

Manage license keys for embedding AI chat widgets on your websites.

Overview

License Keys allow you to:

📦 Plan Requirement

License Keys are available in Growth plan and higher.

Creating a License Key

  1. Navigate to License Keys in the admin panel
  2. Click Create License Key
  3. Configure the key settings:
    • Name: Descriptive name (e.g., "Company Website Widget")
    • Data Source: Restrict to specific database (optional)
    • Agent: Restrict to specific AI agent (optional)
    • Allowed Domains: Comma-separated list of domains (optional)
    • Monthly Limit: Maximum queries per month (optional)
    • Expiration Date: When the key expires (optional)
  4. Click Create and copy your license key
⚠️ Important

Save your license key securely. You cannot retrieve it later (only regenerate).

Using License Keys

Once created, embed the license key in your website:

Basic Implementation

<script> window.CHAT_WIDGET_CONFIG = { apiUrl: 'https://api.datixlab.com', licenseKey: 'XXXX-XXXX-XXXX-XXXX', position: 'bottom-right' }; </script> <script src="https://cdn.datixlab.com/chat-widget.js"></script>

With Custom Styling

<script> window.CHAT_WIDGET_CONFIG = { apiUrl: 'https://api.datixlab.com', licenseKey: 'XXXX-XXXX-XXXX-XXXX', position: 'bottom-right', theme: 'light', // or 'dark' primaryColor: '#5D87FF', welcomeMessage: 'Hello! How can I help you today?' }; </script> <script src="https://cdn.datixlab.com/chat-widget.js"></script>

License Key Features

Usage Tracking

Monitor how your chat widget is being used:

Usage Limits

Control costs with monthly limits:

Domain Restrictions

Prevent unauthorized use by restricting domains:

Allowed Domains: example.com, www.example.com, app.example.com

The widget will only work on specified domains.

Data Source & Agent Binding

Control what data the widget can access:

Managing License Keys

Viewing Usage

  1. Go to License Keys page
  2. Click the History icon next to a key
  3. View detailed usage logs:
    • Timestamp of each query
    • Question asked
    • Response time
    • IP address and referrer

Updating a License Key

You can update:

💡 Tip

Instead of deleting keys, mark them inactive to preserve usage history for auditing.

Revoking Access

To immediately stop a widget from working:

  1. Find the license key
  2. Toggle Active to OFF
  3. The widget will stop working immediately

Security Best Practices

API Reference

Create License Key

POST /api/license-keys Authorization: Bearer {token} { "name": "My Website Widget", "data_source_id": "abc-123", "agent_id": "agent-456", "allowed_domains": "example.com", "monthly_usage_limit": 1000, "expires_at": "2026-12-31T23:59:59Z" }

List License Keys

GET /api/license-keys Authorization: Bearer {token}

Update License Key

PATCH /api/license-keys/{key_id} Authorization: Bearer {token} { "is_active": false, "monthly_usage_limit": 2000 }

Get Usage History

GET /api/license-keys/{key_id}/usage?limit=100 Authorization: Bearer {token}

Troubleshooting

Widget Not Showing

Queries Not Working

Usage Not Tracking