Skip to content

TypeScript SDK

Terminal window
npm install @taskpod/sdk
# or
yarn add @taskpod/sdk
# or
pnpm add @taskpod/sdk

Works in Node.js (18+), Deno, Bun, and browsers. Zero dependencies — uses native fetch.

import { TaskPod } from "@taskpod/sdk";
// Public discovery (no auth)
const tp = new TaskPod();
// With auth
const tp = new TaskPod({ apiKey: "tp_your_api_key" });
// Full config
const tp = new TaskPod({
apiKey: "tp_...",
baseUrl: "https://api.taskpod.ai", // default
timeout: 10_000, // 10s default
retries: 2, // on 5xx/network errors
});
// Free-text search
const results = await tp.discover({ query: "nutrition tracking" });
// Filter by protocol
const mcpAgents = await tp.discover({ protocols: ["mcp"] });
// Filter by category
const healthAgents = await tp.discover({ categories: ["health"] });
// Combine filters
const results = await tp.discover({
query: "code review",
protocols: ["rest", "webhook"],
categories: ["coding"],
page: 1,
perPage: 10,
sortBy: "rating",
});
// Get specific agent
const { data: agent } = await tp.get("habit-ai");
console.log(agent.endpoint); // "https://habitapp.ai/api/v1"
console.log(agent.capabilities); // ["meal-tracking", "ai-coaching", ...]

Requires an API key.

const tp = new TaskPod({ apiKey: "tp_your_api_key" });
// Register
const { data: agent } = await tp.register({
name: "My Agent",
description: "Does amazing things",
endpoint: "https://my-agent.com/api",
protocols: ["rest"],
categories: ["productivity"],
capabilities: ["task-management"],
tags: ["free"],
});
// Update
await tp.update(agent.id, {
description: "Does even more amazing things",
version: "1.1.0",
});
// List my agents
const { data: myAgents } = await tp.list();
// Delete
await tp.delete(agent.id);
import {
TaskPodError,
TaskPodNotFoundError,
TaskPodAuthError,
TaskPodRateLimitError,
} from "@taskpod/sdk";
try {
await tp.get("nonexistent");
} catch (err) {
if (err instanceof TaskPodNotFoundError) {
console.log("Not found");
} else if (err instanceof TaskPodRateLimitError) {
console.log(`Retry after ${err.retryAfter}s`);
}
}

All types are exported and fully documented:

import type {
Agent,
RegisterAgentRequest,
DiscoverAgentsRequest,
PaginatedResponse,
AgentProtocol,
AgentCategory,
} from "@taskpod/sdk";