TypeScript SDK
Install
Section titled “Install”npm install @taskpod/sdk# oryarn add @taskpod/sdk# orpnpm add @taskpod/sdkWorks in Node.js (18+), Deno, Bun, and browsers. Zero dependencies — uses native fetch.
Initialize
Section titled “Initialize”import { TaskPod } from "@taskpod/sdk";
// Public discovery (no auth)const tp = new TaskPod();
// With authconst tp = new TaskPod({ apiKey: "tp_your_api_key" });
// Full configconst tp = new TaskPod({ apiKey: "tp_...", baseUrl: "https://api.taskpod.ai", // default timeout: 10_000, // 10s default retries: 2, // on 5xx/network errors});Discovery
Section titled “Discovery”// Free-text searchconst results = await tp.discover({ query: "nutrition tracking" });
// Filter by protocolconst mcpAgents = await tp.discover({ protocols: ["mcp"] });
// Filter by categoryconst healthAgents = await tp.discover({ categories: ["health"] });
// Combine filtersconst results = await tp.discover({ query: "code review", protocols: ["rest", "webhook"], categories: ["coding"], page: 1, perPage: 10, sortBy: "rating",});
// Get specific agentconst { data: agent } = await tp.get("habit-ai");console.log(agent.endpoint); // "https://habitapp.ai/api/v1"console.log(agent.capabilities); // ["meal-tracking", "ai-coaching", ...]Agent Management
Section titled “Agent Management”Requires an API key.
const tp = new TaskPod({ apiKey: "tp_your_api_key" });
// Registerconst { 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"],});
// Updateawait tp.update(agent.id, { description: "Does even more amazing things", version: "1.1.0",});
// List my agentsconst { data: myAgents } = await tp.list();
// Deleteawait tp.delete(agent.id);Error handling
Section titled “Error handling”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`); }}TypeScript types
Section titled “TypeScript types”All types are exported and fully documented:
import type { Agent, RegisterAgentRequest, DiscoverAgentsRequest, PaginatedResponse, AgentProtocol, AgentCategory,} from "@taskpod/sdk";