Skip to main content
The Agentic Trust widget is a lightweight JavaScript bundle that renders a chat interface on your site. It connects to your project’s API and streams AI responses in real time.

Basic setup

1

Add the script

Include the widget script before your initialization code:
<script src="https://platform.agentictrust.com/widget.js"></script>
2

Initialize

Choose between synchronous and asynchronous initialization:
<script>
  AgenticTrust.initAsync({
    projectId: "proj_your_project_id",
    apiUrl: "https://platform.agentictrust.com/api/v1",
    apiKey: "lum_pk_your_api_key"
  });
</script>
initAsync fetches the widget configuration from the server before rendering, so the widget reflects your dashboard settings (colors, position, branding). init uses defaults and renders immediately.
3

Verify

Reload your page. A chat bubble appears in the bottom-right corner (default position). Click it to open the chat panel.

Configuration options

Pass these properties to init or initAsync:
PropertyTypeRequiredDescription
projectIdstringYesYour project ID (proj_...)
apiUrlstringYesAPI base URL
apiKeystringYesPublic API key (lum_pk_...)
userobjectNoEnd user identity (see Identity)
userTokensobjectNoCustom headers forwarded to action endpoints

Full example

<!DOCTYPE html>
<html>
<head>
  <title>My App</title>
</head>
<body>
  <h1>Welcome</h1>

  <script src="https://platform.agentictrust.com/widget.js"></script>
  <script>
    AgenticTrust.initAsync({
      projectId: "proj_your_project_id",
      apiUrl: "https://platform.agentictrust.com/api/v1",
      apiKey: "lum_pk_your_api_key",
      user: {
        id: "user-42",
        email: "user@example.com",
        name: "Jane Doe",
        hmac: "computed_hex_signature"
      },
      userTokens: {
        Authorization: "Bearer user_jwt"
      }
    });
  </script>
</body>
</html>
The widget script is cached for 1 hour with a stale-while-revalidate window of 1 day. Users always get a fast load with automatic background updates.