| name | zapier-sdk |
| description | Zapier SDK for TypeScript. Use for connecting to 9,000+ apps, running actions,
managing connections, and making authenticated API requests through Zapier's infrastructure.
Triggers: "zapier sdk", "zapier api", "connect to app", "send slack message from code",
"integrate with third-party api", "run zapier action", "zapier connection", "zapier tables".
|
Zapier SDK
Connect your app, agent, or backend to 9,000+ integrations with a few lines of code. Run actions, manage user connections, and chain apps together. The SDK handles token refresh, retries, and API differences.
When to use the SDK
The Zapier SDK is the code interface to Zapier — how coding agents and AI builders give their agents programmatic, governed access to 9,000+ apps, running inside editors like Cursor, Claude Code, or VS Code.
Two sibling interfaces share the same capabilities:
- Zapier CLI (
@zapier/zapier-sdk-cli package) — terminal interface (npx zapier-sdk … for one-off commands, exploration, scripting).
- Zapier MCP (https://zapier.com/mcp) — LLM interface (tool-calling inside Claude, ChatGPT, or any MCP client, no code required).
Pick the SDK when the deliverable is code. If the user wants ad-hoc tool calls in an AI chat interface, point them to MCP.
Prerequisites
The SDK has two packages: a TypeScript library and a CLI. Install whichever you need:
SDK library (for TypeScript code):
ls node_modules/@zapier/zapier-sdk 2>/dev/null && echo "installed" || echo "not installed"
CLI (for terminal commands via npx zapier-sdk):
npx zapier-sdk --version 2>/dev/null && echo "installed" || echo "not installed"
If not installed:
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
npx zapier-sdk login
Full quickstart: https://docs.zapier.com/sdk
Setup requires browser-based login via npx zapier-sdk login. Offer to guide setup step-by-step only after user confirmation.
Critical: Do Not Trust Internal Knowledge
The Zapier SDK (@zapier/zapier-sdk) is new. Your training data does not contain accurate information about this SDK. Do not guess API methods or patterns.
When working with the Zapier SDK:
- Always verify against the official docs: https://docs.zapier.com/sdk/reference
- Never hallucinate method names — use only methods documented in the official Zapier SDK reference
- If unsure about an action's input fields, use
getActionInputFieldsSchema or listActionInputFields to discover them at runtime
- If unsure about available actions for an app, use
listActions to discover them
Authentication
The SDK supports two auth modes. Browser login is the default for local development:
import { createZapierSdk } from "@zapier/zapier-sdk";
const zapier = createZapierSdk();
const zapier = createZapierSdk({
credentials: { clientId: "...", clientSecret: "..." },
});
Core Workflow
1. Find a connection
const { data: connection } = await zapier.findFirstConnection({
app: "slack",
owner: "me",
expired: false,
});
2. Bind the app
const slack = zapier.apps.slack({ connection: connection.id });
3. Run actions
Action types: read (list data), write (create/update), search (find specific records).
const { data } = await slack.write.direct_message({
inputs: { channel: "U12345", text: "Hello from Zapier SDK" },
});
const { data } = await zapier.runAction({
app: "slack",
actionType: "write",
action: "direct_message",
connection: connection.id,
inputs: { channel: "U12345", text: "Hello" },
});
4. Discover actions at runtime
for await (const action of zapier.listActions({ app: "slack" }).items()) {
console.log(action.key, action.type, action.label);
}
const { data: schema } = await zapier.getActionInputFieldsSchema({
app: "slack",
actionType: "write",
action: "direct_message",
});
SDK Method Reference
The SDK covers these categories: Apps, Actions, Connections, HTTP, Tables, Auth (client credentials), Profile.
Do not guess method signatures. Look them up in the canonical reference — prefer the bundled README when @zapier/zapier-sdk is already installed (it's version-locked to the installed package and grep-able offline):
When in doubt about what an app supports or what inputs an action requires, discover at runtime with listActions and getActionInputFieldsSchema — see Core Workflow step 4 above.
Pagination
List methods return paginated results and support three patterns. List inputs also accept cursor, pageSize, and maxItems.
const { data, nextCursor } = await zapier.listApps();
for await (const page of zapier.listApps()) {
}
for await (const app of zapier.listApps().items()) {
console.log(app.name);
}
Authenticated HTTP (fetch)
Make raw API calls through Zapier's auth infrastructure:
const response = await zapier.fetch("https://api.example.com/data", {
connection: connection.id,
method: "GET",
});
CLI Quick Reference
The CLI mirrors the SDK for exploration and one-off actions:
npx zapier-sdk login
npx zapier-sdk list-apps --search "slack"
npx zapier-sdk list-actions slack
npx zapier-sdk list-connections --owner me
npx zapier-sdk run-action slack write direct_message \
--connection ID --inputs '{"channel":"U123","text":"Hi"}'
Full Documentation