| name | sdk-ts |
| description | Help writing TypeScript or JavaScript code using the @fiberai/sdk package. Use when the user wants to build an application, integration, or automation that calls Fiber AI APIs programmatically. |
| user-invocable | true |
| argument-hint | <what you want to build> |
Fiber AI TypeScript SDK
Help the user write TypeScript or JavaScript code using the @fiberai/sdk package.
When to Use
- User wants to BUILD an application using Fiber AI (not just query via MCP)
- User says "build", "create app", "write code", "typescript", "javascript", "node"
- User wants a wrapper, integration, data pipeline, or product on top of Fiber APIs
Do Not Use When
- User just wants to search or enrich via chat — use
/fiber:search or /fiber:enrich instead
- User wants to write Python code — use
/fiber:sdk-py instead
Quick Start
import { createClient, companySearch } from "@fiberai/sdk";
const client = createClient({
baseUrl: "https://api.fiber.ai",
});
const result = await companySearch({
client,
body: {
apiKey: process.env.FIBER_API_KEY!,
searchParams: { },
pageSize: 25,
},
});
Key Concepts
- The SDK provides typed functions for every API endpoint
- Each API operationId becomes a named exported function (e.g.,
companySearch, peopleSearch, syncQuickContactReveal)
apiKey is passed in the request body (for POST) or query string (for GET), not as a header
- Search filters go inside a
searchParams object, not a filters object
- Pagination uses
cursor, not page
- All functions are async and return typed responses
zod is included for runtime validation schemas
Schema & Type Discovery
Fiber's request/response schemas are large and evolve across versions. The SDK is the best source of truth for field names and types:
- From the installed package: check the exported types in
@fiberai/sdk. Every operation function has fully typed parameters and return values. Use IDE autocomplete or inspect node_modules/@fiberai/sdk to discover available fields for searchParams, enrichmentType, etc.
- From online docs: per-operation pages at
https://api.fiber.ai/ai-docs/<operationId>.md describe every field with examples. Start with https://api.fiber.ai/llms.txt for routing.
- From MCP at runtime: call
get_endpoint_details_full("<operationId>") on the Core MCP to get the full current schema.
- Open-source examples:
https://github.com/fiber-ai/open-fiber has working code samples.
Important Rules
- Always use environment variables for API keys — never hardcode secrets
- Always pass
apiKey in the request body or query, not as a header
- Handle HTTP error responses: 401 (auth), 402 (insufficient credits), 429 (rate limit)
- For bulk operations, use the audience workflow (create, set params, build, estimate, enrich, export)
- Check https://api.fiber.ai/docs/ for the current API schema — parameters and response shapes may change between SDK versions
Detailed Examples
See the references/ folder for:
- Full client setup with error handling
- Company and people search with the correct body structure
- Contact enrichment patterns
For AI agents: machine-readable docs