Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.09 KB

File metadata and controls

96 lines (71 loc) · 2.09 KB

SDK Quickstart

The official TypeScript SDK for the Taskade API. Build AI-powered apps with Projects, Agents, Automations, and Genesis.

Install

npm install @taskade/sdk

Setup

import { Taskade } from '@taskade/sdk';

const taskade = new Taskade({
  apiKey: process.env.TASKADE_API_KEY,
});

Get your API key from Settings > API.

Examples

List Workspaces

const { items: workspaces } = await taskade.workspaces.list();
console.log(workspaces);

Create a Task

await taskade.tasks.create('project-id', {
  tasks: [{ text: 'Follow up with client' }],
  placement: 'afterbegin',
});

Get Project Tasks

const { items: tasks } = await taskade.projects.listTasks('project-id');
for (const task of tasks) {
  console.log(`${task.completed ? '✓' : '○'} ${task.text}`);
}

Manage Agents

// Get agent details
const { item: agent } = await taskade.agents.get('agent-id');

// Add a project as knowledge source
await taskade.agents.addProjectKnowledge('agent-id', {
  projectId: 'project-id',
});

Export a Genesis App

// Export a complete Genesis app as a bundle
const bundle = await taskade.bundles.export('space-id');

// Import into another workspace
await taskade.bundles.import('workspace-id', {
  bundleData: bundle,
});

Error Handling

import { Taskade, TaskadeAPIError } from '@taskade/sdk';

try {
  await taskade.projects.get('invalid-id');
} catch (error) {
  if (error instanceof TaskadeAPIError) {
    console.log(error.status);     // 404
    console.log(error.statusText); // "Not Found"
  }
}

Resources

Resource Description
Full API Reference Complete endpoint documentation
GitHub: @taskade/sdk SDK source code
Agent Cookbook Use cases and architecture patterns
Community Apps 120+ Genesis apps