Deploy · Control

Governed chat widget

Add a protected chat surface to your site. Each send is an independent governed POST /run — Boundary checks the prompt before provider inference. Use a script tag or an npm adapter; all paths share the same core.

Choose an integration

Script embed

On quantlix.ai, the portal serves the widget at /chat/v1.js (built from @quantlix-ai/chat-core). Production CDN: https://cdn.quantlix.ai/chat/v1.js.

Inline (mount in your page)

<!-- Try it live -->
<div id="quantlix-chat-root"></div>
<script
  src="https://cdn.quantlix.ai/chat/v1.js"
  data-deployment="YOUR_DEPLOYMENT_ID"
  data-api-key="pk_YOUR_PUBLISHABLE_KEY"
  data-mode="inline"
  data-theme="dark"
  data-greeting="Messages are checked by Quantlix before the model."
  async
></script>

Floating launcher

<script
  src="https://cdn.quantlix.ai/chat/v1.js"
  data-deployment="YOUR_DEPLOYMENT_ID"
  data-api-key="pk_YOUR_PUBLISHABLE_KEY"
  data-position="bottom-right"
  async
></script>

Script attributes

AttributeRequiredNotes
data-deploymenttrueDeployment id from the dashboard.
data-api-keyone of key or runUrlPublishable key (pk_…). Never use secret qxl_ keys in HTML.
data-run-urlone of key or runUrlSame-origin proxy URL; session cookie auth instead of api-key.
data-api-urlfalseAPI base (default https://api.quantlix.ai).
data-modefalseinline (mount in #quantlix-chat-root) or floating (default).
data-targetfalseCSS selector for inline mount (default #quantlix-chat-root).
data-positionfalsebottom-right or bottom-left (floating).
data-themefalsedark, light, or auto.
data-greetingfalseFirst line shown in the transcript.
data-providerfalseOptional gateway routing metadata.
data-modelfalseOptional gateway routing metadata.
data-lazyfalsetrue or 1 to defer init until visible.

npm packages

Framework adapters wrap @quantlix-ai/chat-core — they do not reimplement chat logic. Published on npm under the @quantlix-ai scope.

React (Next.js App Router)

pnpm add @quantlix-ai/chat-react @quantlix-ai/chat-core

// components/quantlix-chat.tsx
"use client";
import { QuantlixChat } from "@quantlix-ai/chat-react";

export function QuantlixChatPanel() {
  return (
    <QuantlixChat
      deploymentId={process.env.NEXT_PUBLIC_QUANTLIX_DEPLOYMENT_ID!}
      apiKey={process.env.NEXT_PUBLIC_QUANTLIX_PUBLISHABLE_KEY!}
      theme="dark"
      greeting="Try a message — Quantlix checks it before the model."
    />
  );
}

Vue 3 (Nuxt)

pnpm add @quantlix-ai/chat-vue @quantlix-ai/chat-core vue

<script setup lang="ts">
import { QuantlixChat } from "@quantlix-ai/chat-vue";
</script>

<template>
  <ClientOnly>
    <QuantlixChat
      deployment-id="YOUR_DEPLOYMENT_ID"
      :api-key="publishableKey"
      theme="dark"
    />
  </ClientOnly>
</template>

Svelte 5 (SvelteKit)

pnpm add @quantlix-ai/chat-svelte @quantlix-ai/chat-core svelte

<script lang="ts">
  import { browser } from "$app/environment";
  import { QuantlixChat } from "@quantlix-ai/chat-svelte";
</script>

{#if browser}
  <QuantlixChat
    deploymentId="YOUR_DEPLOYMENT_ID"
    apiKey="pk_YOUR_PUBLISHABLE_KEY"
  />
{/if}

Shared props: deploymentId, apiKey, apiUrl, runUrl, theme, position, greeting, provider, model, mode, lazy. Adapters mount only in the browser (SSR-safe).

Keys, CORS, and security

Portal sandbox bot protection

The public Boundary sandbox and homepage hero demo can require Cloudflare Turnstile when your portal deployment sets both NEXT_PUBLIC_TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY. That protects Quantlix-hosted demos — not customer sites embedding the widget. Create keys in the Cloudflare dashboard → Turnstile → add widget domains (localhost, production host).

Related