Skip to main content

SDK Resources

Resources group operations by entity so integrations stay readable and maintainable.

Step 1: Start with Project Resources

const projects = await client.projects.list();
const project = await client.projects.get(projectId);

Step 2: Add Run or Workflow Resources

const run = await client.runs.create({ projectId, goal: "Create sprint plan" });
const status = await client.runs.get(run.id);

Step 3: Manage Documents and Artifacts

const docs = await client.documents.list({ projectId });

Step 4: Add Error Handling per Resource Family

  1. Handle permission errors explicitly.
  2. Retry transient errors with backoff.
  3. Surface actionable errors to operators.

Step 5: Build Reusable Service Wrappers

Create local wrappers around SDK resources to enforce:

  • Input validation.
  • Logging and metrics.
  • Tenant policy checks.

Use this pattern to keep business logic out of controllers and scripts.