TypeScript SDK
Use the typed ActionBox SDK from Node.js services, workers, serverless functions, and CI tooling.
The official Node.js SDK requires Node.js 18 or newer. Keep it and its Source API key in trusted server-side code; do not bundle credentials into a browser application.
Install
npm install @actionbox/sdkimport { ActionboxClient } from "@actionbox/sdk";
const client = new ActionboxClient({ apiKey: process.env.ACTIONBOX_API_KEY! });
const decision = await client.ask({
title: "Deploy to production?",
options: ["Approve", "Reject"],
});The SDK uses https://api.actionbox.cloud by default. Its interaction and response unions match the REST API.
Set context_request_mode: "poll" only when the integration monitors Action
updates and can answer reviewer questions. Use "callback" with a
callback_url when the handler supports action.context_requested. The
default "unsupported" mode hides the follow-up control for static scripts.
Route to a reviewer
await client.create({ title: "Review the migration", assignee_email: "reviewer@example.com" });
// Or use assignee_user_id: "usr_..." for stored automation config.
await client.create({
title: "Approve emergency access",
visibility: "restricted",
reviewer_emails: ["incident@example.com", "security@example.com"],
});Copy an ID from Settings → Team. Send email or ID, not both. See Assignments and routing for the compact schema.
Add a typed approval_policy to require votes from any reviewer, every reviewer, or a quorum. Polling exposes approval_progress and continues until the Action is terminal. Source-authenticated SDK clients cannot cast human votes. See Approval Policies.
Typed interactions
import type { BooleanInteraction } from "@actionbox/sdk";
const interaction: BooleanInteraction = {
type: "boolean",
label: "Deploy now?",
true_label: "Deploy",
false_label: "Hold",
};
const action = await client.create({ title: "Deploy configuration", interaction });See interaction types and the API reference.