Installation
Choose your preferred installation method:- Script Tag
- React SDK
Add the script before
</body>:After the script loads, use
window.argide() to pass functions and objects:Find Your Product ID
- Go to dashboard.argide.ai/dashboard/deploy/widget
- Copy your Product ID
User Identity
Authenticate users for persistent conversations and user-specific actions.- Script Tag
- React SDK
Option A — Auto-refresh (recommended). Pass a function that fetches a JWT. The SDK calls it on mount and re-calls it automatically when the token expires (401):Option B — Manual. Pass a static token (you handle refresh yourself):
Client-Side Tools
Register tools the agent can call. The return value from your handler is sent back to the agent, so it can confirm success or handle errors intelligently. See Client-Side Tools for full setup.- Script Tag
- React SDK
Tool Result Callbacks
React to server-side tool completions — refresh data, show a diff UI, dispatch events, etc.- Script Tag
- React SDK
Tool Renderers
Render custom visuals inline in the chat when a tool completes — data cards, tables, charts, and more. Your renderer receives{ result, status } and returns one of:
- Script Tag
- React SDK
Quick Q&A
Some users find it more intuitive to read setup instructions in Q&A format. Here’s everything above as quick answers:How do I add the chat to my app?
How do I add the chat to my app?
Install the SDK and drop in one component:That’s it. Chat works anonymously out of the box. No provider wrapping needed.
How do I authenticate users?
How do I authenticate users?
Two steps:The SDK calls this on mount and auto-refreshes when the token expires. No
- Create a backend endpoint (~15 lines) that reads your existing session and mints a JWT signed with your Argide verification secret. Argide never sees your auth system — the JWT is the bridge.
- Pass it as a prop:
useEffect, no setInterval, no manual calls.This enables: conversation history, personalized responses, and user-specific tool actions.See Identity Verification for the backend JWT setup.How do I give the AI context about the current page?
How do I give the AI context about the current page?
Pass a This gets injected into the AI’s system prompt so it can perform page-aware actions like “edit this item” without asking which one.
context object. It’s reactive — when it changes (e.g., user navigates), the AI automatically knows.How do I react when the AI calls a tool?
How do I react when the AI calls a tool?
React SDK — use Script Tag — use
onToolResult and toolRenderers as props:window.argide():What does the full setup look like?
What does the full setup look like?
Everything is a prop on one component:No providers, no initializers, no polling.
