Skip to main content
Already using Candu? Candu Actions runs alongside the classic Candu SDK. If you have candu.umd.js installed for content rendering, you can add the Actions snippet below in the same app — both load from cdn.candu.ai and don’t conflict. See the classic Candu install guide.

What you’ll see after install

With the snippet installed, open your app and type into the chat:
“Create a segment of inactive enterprise users”
Candu Actions will match the request to your segments_create action, ask for any missing inputs one at a time, show a confirmation panel with the exact payload before anything fires, execute the POST to your API, and log the run. Nothing executes until the user confirms.

See the full flow

Watch the segment wizard end to end: every tool call, payload, and log.

1

Add the snippet

Paste this into your app just before </body>. You only need to change four values: clientToken, userId, identifiers, and your auth header in fetchFn. The last two are optional.
Your clientToken is in the Candu Actions dashboard under Settings → Installation. Your userId should match the identifier you use to identify users elsewhere in your product.
Candu Actions executes actions inside your app using your authentication context. Your APIs are never called from an external service.
2

Wire your auth (optional)

If your app uses session cookies, omit fetchFn entirely — the snippet includes credentials: "include" by default and no extra setup is needed. For bearer tokens, CSRF signatures, or custom headers, pass a fetchFn that returns a fetch() with the headers you need. Keep it short — it runs on every action call.
3

Define your actions

Your action registry is a JSON file referenced by your clientToken. Each action maps to one API endpoint.
Getting Started, 3 Define Your Actions

Each action has a description, role targeting, governance policy, and a Booster that controls how the AI calls it

Set execution_policy: "confirm" on write actions where you want the user to review the payload before it fires. Not every write needs confirmation — use your judgement based on the risk of the action.
4

See it work

Reload your app. The chat is now in the bottom right. Try the example from the top of this page.

React and Next.js

The snippet works in any framework that can run a script tag. In React or Next.js, run it inside a useEffect in your root layout. Pass clientToken, userId, and your auth via fetchFn — same shape as the vanilla setup. Reach out if you want help with your specific framework.
Both the chat widget and wizard UI run inside a shadow DOM, so your app’s styles won’t conflict with Candu’s and vice versa. Wizards render inline; the chat widget renders as a floating panel.
Now that the SDK is installed, your team can start building wizards. Send your CX or product team to the user-facing wizard documentation to learn about configuring wizards in the Candu UI.