Mounting the Widget
Embed powerful Conversational AI directly into your SaaS ecosystem using our lightweight client script or React SDK.
1. Locate your Workspace ID
Every widget instance is securely anchored to a specific Workspace. Navigation requires this cryptographically unique sequence.
- 1Open the Workspace detail view in your dashboard.
- 2Copy the Workspace ID located under the workspace header settings.
Standard HTML / Vanilla JS
Inject our lightweight orchestration engine at the base of your document body.
<!-- Append terminal node before </body> -->
<script
src="https://cdn.stellix.ai/v1/widget.js"
data-workspace-id="YOUR_WORKSPACE_ID"
data-theme="light"
data-primary-color="#6366f1"
defer
></script>React / Next.js Framework
For modern React applications, use our type-safe primitive for deep UI control and framework persistence.
import { StellixWidget } from '@stellix/react';
export default function AppRoot() {
return (
<main>
<StellixWidget
workspaceId="YOUR_WORKSPACE_ID"
theme="light"
primaryColor="#6366f1"
/>
</main>
);
}Row-Level Security (RLS)
For multi-tenant SaaS environments, enforce strict cryptographic isolation via JWT handshakes to prevent data bleed.
Never pass raw user filters from the browser. Malicious payloads are easily spoofed. Stellar enforces Nested Audience RLS using Cryptographic Signatures generated by your private backend node.
Generate JWT
Sign your desired hard constraints (e.g. tenant_id) using your Secret Key on your secure backend server.
const token = jwt.sign(
{ tenant_id: 'tenant_123' },
SECRET_KEY
);Hydrate Widget
Pass the resulting token to the widget parameter. The engine will verify the signature before SQL execution.
<StellixWidget
workspaceId="YOUR_ID"
token={token}
/>