Skip to content

Quickstart

Install

Terminal window
npm install @justack/sdk

API Key

Get your API key from the Justack Dashboard under Settings > API Keys.

.env
JUSTACK_API_KEY=jstk_xxxxxxxxxxxxx

Example

import { JustackClient } from "@justack/sdk";
const client = new JustackClient({
apiKey: process.env.JUSTACK_API_KEY,
});
const session = await client.sessions.create({
name: "Production Deployment",
recipients: [{ email: "ops-team@example.com" }],
notify: true,
});
await session.log("Deployment pipeline started for v2.1.0");
const { approved, notes } = await session.ask("Approve deployment to production?", {
inputs: [
{ type: "confirm", name: "approved" },
{ type: "text", name: "notes", label: "Additional notes" },
] as const,
});
// approved: boolean, notes: string
if (approved) {
await session.log("Deploying...");
} else {
await session.log(`Rejected. Notes: ${notes}`);
}
session.close();

Runtime Support

EnvironmentSupported
Node.js 18+Yes
BunYes
DenoYes
Cloudflare WorkersYes
BrowserNo*

*The SDK requires an API key and should only be used server-side.

Next Steps