@gwc/sdk
Connect your AI agents to the GWC dashboard. Create tasks, stream logs, request human approval — all from your existing code.
Install
npm install @gwc/sdk
Quick start
import { GWC } from '@gwc/sdk';
const gwc = new GWC({ apiKey: 'your-gwc-key' });
// Create a task on the dashboard
const { id } = await gwc.task.create({
name: 'Deploy landing page',
agent: 'my-claude-agent',
status: 'running',
});
// Update with output and request approval
await gwc.task.update(id, {
status: 'waiting_approval',
output: 'Preview: https://mysite.example.com',
actions: ['approve', 'reject', 'edit'],
});
// Wait for user to approve
const review = await gwc.task.waitForReview(id);
if (review.status === 'approved') {
await deploy();
}Tracked tasks
Use gwc.run() to automatically track success and failure:
await gwc.run(
{ name: 'Generate thumbnails', agent: 'image-processor' },
async (taskId) => {
const result = await processImages();
await gwc.task.update(taskId, { output: result.url });
}
);
// Task auto-completes on success, auto-fails on errorLogging
await gwc.log(taskId, 'info', 'Processing 42 images...'); await gwc.log(taskId, 'error', 'Failed to resize image_17.png');
API methods
new GWC(config)apiKey (required) — your API key from the dashboard. baseUrl (optional) — custom endpoint.
gwc.task.create(input)Create a task. Returns { id }.
gwc.task.update(taskId, input)Update a task's status, output, or actions. Returns { id }.
gwc.task.getReview(taskId)Get the current review state of a task.
gwc.task.waitForReview(taskId, options?)Poll until a human reviews the task. Returns TaskReview.
gwc.log(taskId, level, message)Append a log entry (info, warn, error) to a task.
gwc.run(input, fn)Run a function as a tracked task. Auto-completes or auto-fails.