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.
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.