Quickstart
Install
npm install @justack/sdkpnpm add @justack/sdkbun add @justack/sdkAPI Key
Get your API key from the Justack Dashboard under Settings > API Keys.
JUSTACK_API_KEY=jstk_xxxxxxxxxxxxxExample
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
| Environment | Supported |
|---|---|
| Node.js 18+ | Yes |
| Bun | Yes |
| Deno | Yes |
| Cloudflare Workers | Yes |
| Browser | No* |
*The SDK requires an API key and should only be used server-side.
Next Steps
- Sessions Guide - Deep dive into session management
- Recipients Guide - Learn about recipient management
- TypeScript SDK - Complete SDK reference