How to Use the Zapier SDK with Claude Code: Run App Actions from Agent Code
Introduction
Coding agents are good at writing glue code and bad at maintaining it. Every new app integration means another OAuth flow, another token refresh routine, another retry policy, and another API whose error format differs from the last one. The Zapier SDK removes that layer: one package, one login, and programmatic access to the actions of thousands of apps, so your agent writes business logic instead of auth plumbing. This tutorial sets up the SDK inside a Claude Code project, connects a real app, and runs a real action from both the CLI and TypeScript, then shows how to govern what the agent is allowed to do.
Quick answer
Install @zapier/zapier-sdk, run npx zapier-sdk login, connect an app with npx zapier-sdk create-connection, then call any action from the CLI with run-action or from TypeScript with createZapierSdk().
Evidence
The scale claim is the vendor’s own. The Zapier SDK quickstart describes installing @zapier/zapier-sdk, authenticating once, and executing actions across more than 9,000 apps, and the Zapier SDK repository repeats that any of Zapier’s 9,000+ apps works with the same commands. The companion MCP server page puts the action count at more than 40,000 actions across that catalog, which is why the SDK pitch is about breadth, not about one favorite integration. As of October 29, 2026, the quickstart requires Node.js 20 or newer and states that a free Zapier account works, so the setup below costs nothing beyond the apps you connect.
Zapier’s own framing for the product is short. The Zapier SDK product page says, “Let your agent connect to anything. Authenticated, governed access to the full Zapier catalog, in code, on behalf of your users. No OAuth flows. No token management. Zapier handles the keys.” The repository README states the same idea in plainer terms: “Programmatic access to Zapier’s full app ecosystem via @zapier/zapier-sdk on npm. Any API call, on behalf of a user.” The two words that matter for agent work are “governed” and “on behalf of”: actions run through connections you control, under policies you can restrict, rather than through credentials pasted into agent prompts.
The SDK versus MCP choice follows from where the logic lives. If you want to ask an assistant in plain language to send a message or add a row, the MCP server is the shorter path, and our Make MCP server tutorial shows the same pattern on the Make side. If the logic lives in code, a script, a backend service, or an agent codebase that must run unattended, the SDK is the right tool, because actions become function calls your code can branch on, retry, and test. This tutorial covers the SDK path; keep MCP in mind as the no-code alternative for the same catalog.
Prerequisites
- Node.js 20 or newer installed (
node -vshould print v20 or higher) - A Zapier account (the free tier works)
- A Claude Code project, or any folder where you can run a terminal
- At least one app you can connect for testing, such as Notion, Slack, or Gmail
- Basic comfort with npm and TypeScript, since the SDK is TypeScript-only
Step-by-step guide
Step 1: Create the project and install the SDK
Create a folder or open your existing Claude Code project, then install the runtime SDK plus the CLI and TypeScript tooling as development dependencies. The official quickstart uses exactly these commands:
mkdir my-zapier-project && cd my-zapier-project
npm init -y && npm pkg set type=module
npm install @zapier/zapier-sdk
npm install -D @zapier/zapier-sdk-cli @types/node typescript
npx tsc --init
The type=module line matters: the SDK examples use ES module imports, so a CommonJS project will fail on the import statement in Step 5. If you already have a project, skip the first two lines and run only the two npm install commands.
Step 2: Install the SDK skill so Claude Code knows the SDK
The SDK ships as an installable agent skill, which teaches your coding agent the SDK’s commands, patterns, and examples across every future session. Install it with:
npx skills add zapier/sdk -y
The official quickstart says this skill works with Claude Code, Cursor, Codex, OpenCode, Windsurf, and more than 50 other coding agents. Alternatively, install the plugin from the Zapier marketplace inside Claude Code with /plugin marketplace add zapier/marketplace followed by /plugin install sdk@zapier. Either route gives the agent the same knowledge; the skill route is the one that works across the most tools. If you prefer to keep the repo visible, cloning https://github.com/zapier/sdk and pointing your agent at skills/zapier-sdk/SKILL.md achieves the same result.
Step 3: Authenticate once with the CLI
Run the login command. It opens your browser, asks you to authorize the SDK CLI, and stores a local credential on your machine:
npx zapier-sdk login
npx zapier-sdk get-profile
New to Zapier? Run npx zapier-sdk signup instead, which creates the account in the same browser flow. The key detail from the official docs is that as long as the CLI package is installed as a development dependency, the SDK automatically picks up this CLI authentication, so your TypeScript code in Step 5 needs no keys in source. Verify the login worked with get-profile, which prints your account details, before moving on. On a headless machine, add --headless and --non-interactive to the login command instead of the browser flow.
Step 4: Connect an app
Every action needs a connection: an OAuth grant that Zapier holds for the app you want to call. List your existing connections, then create one for the app you plan to test. Each create-connection command opens a browser for the app’s OAuth grant:
npx zapier-sdk list-connections
npx zapier-sdk create-connection notion
npx zapier-sdk create-connection slack
Swap notion for the slug of whatever app you need. If you do not know the slug, search the catalog first:
npx zapier-sdk list-apps --search "google sheets"
Then generate TypeScript types for the apps you connected, which gives you autocomplete and type safety in the editor:
npx zapier-sdk add slack google-sheets
Types land in your src or lib folder by default; pass --types-output ./types to change the location. This step is optional but worth doing, because it turns a typo in an action name into a compile error instead of a runtime failure.
Step 5: Run your first action from TypeScript
Create an index.ts file and initialize the SDK. With CLI authentication in place, no credentials argument is needed:
import { createZapierSdk } from "@zapier/zapier-sdk";
// Initialize with browser-based auth (from `zapier-sdk signup` or `zapier-sdk login`).
const zapier = createZapierSdk();
// List the first page of apps
const { data: apps } = await zapier.listApps();
console.log(
"Available apps:",
apps.map((app) => app.title)
);
Run it with:
npx tsx index.ts
If tsx is not installed, add it with npm install -D tsx or run the file through your project’s existing TypeScript runner. Seeing your connected apps printed confirms that authentication, the SDK, and the catalog all work end to end.
Step 6: Fire a real action from the CLI
The fastest way to prove an action works is the CLI’s run-action command, which calls any action without writing code. These examples come from the official repository README and use real action names:
# Search Notion pages by title
npx zapier-sdk run-action notion search page_by_title \
--inputs '{"title":"Meeting Notes","exact_match":"no"}'
# Search Gmail with the standard Gmail query syntax
npx zapier-sdk run-action gmail search message \
--inputs '{"query":"from:receipts@stripe.com"}'
The pattern is always run-action <app> <category> <action> with a JSON --inputs object. Replace the example values with your own, and the command prints the action’s result as JSON. Once the CLI call returns the result you expect, the same action is ready to call from TypeScript code, where you can branch on the result, retry it, or feed it into the next step of an agent workflow.
Step 7: Add connection governance before the agent runs wild
The SDK’s “governed” claim is a feature you must actually configure. The CLI supports approval-gated runs, which force a human confirmation before an action executes:
npx zapier-sdk login --use-approvals
With approvals on, every action pauses for confirmation, which is the right default while an agent is still learning your workflow. Keep approvals on for destructive actions such as sending messages or updating records, and only relax them for read-only actions once the workflow has proven itself. If you build long-running agent workflows on top of the SDK, pair this with the idempotency pattern in our Zapier durable workflows tutorial, so a retried run does not double-apply its effects. For the migration story in the other direction, our Zapier Agents to AI by Zapier migration guide covers what changes when Zapier’s own agent products move.
Troubleshooting
GOVERNANCE_CONTROL_DENIED on a run-action call
This error means the connection’s policy does not allow that action. It is not an authentication failure, so re-running login will not help. Open the connection in your Zapier account, check which actions its policy permits, and either broaden the policy, switch to a connection with broader permission, or choose a different action that the policy allows. If you enabled approvals, also confirm you approved the run, since a denied approval surfaces as a governance error.
EPERM error on ~/.npm/_cacache during npm install
The official SDK guide calls this one out explicitly: an EPERM error on the npm cache usually means the command sandbox is blocking npm’s cache writes, not a file permissions problem. Run the install outside the sandboxed terminal, or configure npm to use a different cache directory with npm config set cache ~/.npm-cache, then retry the install. Do not run npm with elevated privileges to work around it.
“App not found” or wrong slug for list-apps and create-connection
App slugs are not always the display name. Search first with npx zapier-sdk list-apps --search "google sheets" and copy the exact slug from the result, then use that slug in create-connection and run-action. The README’s own examples use google-sheets with a hyphen, while the search phrase uses a space, which is exactly the mismatch that causes this error.
SDK code cannot find CLI credentials
If createZapierSdk() fails to authenticate even though npx zapier-sdk login succeeded, check that @zapier/zapier-sdk-cli is installed as a development dependency in the same project. The automatic credential pickup depends on the CLI package being present in the project, not just installed globally. Re-run npm install -D @zapier/zapier-sdk-cli in the project folder, then run npx zapier-sdk get-profile from the same folder to confirm the CLI sees the credential there.
TypeScript import fails with a module error
This almost always means the project is CommonJS while the SDK examples are ES modules. Check that package.json contains "type": "module", which the quickstart sets with npm pkg set type=module. If your project must stay CommonJS, use a dynamic import() for the SDK module instead of a top-level import statement.
FAQ
The FAQ answers in the front matter cover the most common questions: SDK versus MCP, client support, free tier, Python availability, governance errors, and agent-driven setup.
Conclusion
The Zapier SDK turns Zapier’s catalog into code your agent can call: install the package, log in once, connect an app, and call actions from the CLI or TypeScript, with approvals and connection policies keeping the agent inside bounds. Start with one read-only action, such as searching Notion or Gmail, prove the loop works, then expand to writes behind approvals. Next, compare the no-code side of the same catalog in our Make MCP server tutorial, or harden a multi-step agent workflow with the Zapier durable workflows tutorial.
Frequently asked questions
What is the Zapier SDK, and how is it different from Zapier MCP?
The Zapier SDK is a TypeScript package that lets code, including code written by a coding agent, call actions across Zapier's app catalog directly, with one auth surface for every app. Zapier MCP exposes the same catalog as tools inside an MCP client such as Claude Desktop or Cursor, with no code. Use the SDK when the logic lives in a script, backend, or agent codebase; use MCP when you only want to ask an assistant in natural language.
Does the Zapier SDK work with Claude Code, Cursor, and Codex?
Yes. The official quickstart says the SDK skill works with Claude Code, Cursor, Codex, OpenCode, Windsurf, and more than 50 other coding agents. Install the skill with npx skills add zapier/sdk, or install the SDK plugin from the zapier/marketplace for Claude Code, Codex, or the GitHub Copilot CLI.
Do I need a paid Zapier plan to use the SDK?
No. The official quickstart states that a free Zapier account works, and the SDK guide repeats that you get access on the free tier. You still need at least one app connected to your Zapier account before an action can run, because every action runs through a connection.
Is there a Python version of the Zapier SDK?
No, not as of October 29, 2026. The SDK is TypeScript-only, published as @zapier/zapier-sdk on npm, and it requires Node.js 20 or newer. Python developers can still drive the same actions through Zapier MCP or through Zapier's REST-style webhook paths, but the SDK itself is Node only.
What happens when a connection policy blocks an action?
The SDK returns a GOVERNANCE_CONTROL_DENIED error, which means the connection's policy does not allow that action. It is not an authentication failure. Check the connection's policy in your Zapier account, use a connection with broader permission, or pick a different action that the policy allows.
Can a coding agent run the whole SDK setup by itself?
Mostly. Paste the official setup prompt into your agent and it will check Node, install the packages, and run the CLI commands one at a time. The one step it cannot do alone is the browser OAuth login: you must complete that grant yourself when the CLI opens your browser.