Zapier Sdk 标志

Zapier Sdk

组织
zapier
zapier-sdk

适用于 TypeScript 的 Zapier SDK。通过 Zapier 的 OAuth 和审计层,代表用户以编程方式访问 9,000 多个应用。编写需要在第三方应用中执行操作的代码时使用,例如发送电子邮件、更新或插入 CRM 记录、查找电子表格行或在聊天中发帖,且无需管理各应用自己的 OAuth 或供应商 SDK。触发词:"zapier sdk"、"zapier-sdk"、"@zapier/zapier-sdk"、"runAction"、"run zapier action"、"connect to app via zapier"、"zapier connection"、"zapier tables"、"list actions for zapier app"、"getActionInputFieldsSchema"、"createZapierSdk"。

Add to TypingMind

概览

发布者zapier
代码仓库sdk
技能名称zapier-sdk
星标数
267
复刻数
7
附带文件
5
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 zapier 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Zapier Sdk AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/zapier/sdk/tree/main/skills/zapier-sdk
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zapier/sdk.git /tmp/sdk
mkdir -p .claude/skills
cp -r /tmp/sdk/skills/zapier-sdk .claude/skills/zapier-sdk
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Zapier Sdk,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Zapier Sdk。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Zapier Sdk 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Zapier SDK

Connect your app, agent, or backend to 9,000+ integrations with a few lines of code. Run actions, manage user connections, 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. It gives coding agents and AI builders 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. Read references/cli.md when the user wants shell access instead of code.
  • 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.

Two SDK shapes to distinguish:

  • Plain SDK script (this file): the user's own code calls the SDK. Runs wherever their code runs (Node script, Next.js route, Lambda, CLI).
  • Durable workflow (@zapier/zapier-durable): the user deploys a workflow that Zapier's infrastructure runs on a trigger (webhook, poll, schedule). Retries stay idempotent via ctx.step. Read references/workflows.md when the user wants deployment on Zapier's infrastructure instead of running the code themselves.

Prerequisites

The SDK ships two packages: a TypeScript library and a CLI. Install whichever you need.

Check what's already installed:

bash
# Is the SDK library present?
ls node_modules/@zapier/zapier-sdk 2>/dev/null && echo "SDK installed" || echo "SDK not installed"

# Is the CLI available?
npx zapier-sdk --version 2>/dev/null && echo "CLI installed" || echo "CLI not installed"

# Are you logged in? (returns email + account on success, non-zero exit if not)
npx zapier-sdk get-profile

There is no whoami, no status, no auth. The command for "who am I logged in as" is get-profile. Use zapier-sdk --help before guessing any other command name.

If missing:

bash
# SDK library.
npm install @zapier/zapier-sdk

# CLI plus TypeScript dev deps.
npm install -D @zapier/zapier-sdk-cli @types/node typescript

# Authenticate (opens a browser).
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.

  1. Always verify against the official docs: https://docs.zapier.com/sdk/reference
  2. Never hallucinate method names. Use only methods documented in the reference or shown in this file.
  3. Never invent app keys. Run zapier-sdk list-apps --search <term> or zapier.listApps({ search }) first.
  4. Never invent action keys. Run zapier-sdk list-actions <app> or zapier.listActions({ app }) first.
  5. Never assume input field shapes for dynamic actions. Run zapier-sdk list-action-input-fields <app> <type> <action> against the live connection.

Shell discovery (agents working in the terminal)

Prefer the default output for reading. It already includes slug, key, title, action type, and description in a compact form. Pass --json only when you need to pipe into jq or another tool. --json is a per-command flag (it appears on every subcommand's --help, not on zapier-sdk --help).

bash
# Find apps. --search is a substring match, so `notion` returns Motion,
# Potion, Tree-Nation too. Read the default output to confirm you picked
# the right app before moving on.
npx zapier-sdk list-apps --search notion

# List actions on an app. Short slugs like `notion` work everywhere in
# the CLI. Filter by type to trim the list.
npx zapier-sdk list-actions notion --action-type search

# Inspect an action's inputs. Many are dynamic, so verify against a
# live connection.
npx zapier-sdk list-action-input-fields notion search page_by_title

# Run an action end-to-end. Use --json when you want to parse the result.
CONN=$(npx zapier-sdk find-first-connection notion --json | jq -r '.data.id')

npx zapier-sdk run-action notion search page_by_title \
  --connection "$CONN" \
  --inputs '{"title":"Meeting Notes","exact_match":"no"}' \
  --json

The CLI's run-action accepts the short slug (notion, slack, github), the CLIAPI-suffixed form (NotionCLIAPI), or a versioned ID. The CLIAPI-suffix requirement in the "Gotchas" section applies to the typed SDK library method (sdk.runAction), not the CLI.

Full CLI walkthrough: references/cli.md. Complete command inventory: references/cli-commands.md.

Authentication

The SDK supports two auth modes. Browser login is the default for local development:

typescript
import { createZapierSdk } from "@zapier/zapier-sdk";

// Option 1: browser-based (local dev). Requires `npx zapier-sdk login` first.
const zapier = createZapierSdk();

// Option 2: client credentials (server / CI).
const zapier = createZapierSdk({
  credentials: { clientId: "...", clientSecret: "..." },
});

Core workflow

1. Find or create a connection

Every action needs a connection (an OAuth grant Zapier holds for a specific app + user). Check if one exists:

typescript
// Throws ZapierResourceNotFoundError if no match. Wrap in try/catch, or listConnections() first.
const { data: connection } = await zapier.findFirstConnection({
  app: "notion",
  owner: "me",
  expired: false,
});

If none exists, the user has to complete OAuth in a browser. This step cannot be fully automated: a human must click "authorize" for their account.

bash
npx zapier-sdk create-connection notion   # opens a browser, waits for OAuth

For agent-driven flows: use get-connection-start-url <app> to fetch the URL, present it to the user, then wait-for-new-connection <app> <started-at> to block until they finish.

2. Run an action

Action types: read (list data), write (create/update), search (find specific records).

typescript
// Generic form (works for any app + action). Preferred.
const { data } = await zapier.runAction({
  appKey: "NotionCLIAPI",
  actionType: "search",
  actionKey: "page_by_title",
  connection: connection.id,
  inputs: { title: "Meeting Notes", exact_match: "no" },
});

For actions on the stable typed surface (documented in the SDK reference), a typed shorthand zapier.apps.<app>.<type>.<action>({ inputs }) is available. Check the reference for coverage; not every app is typed.

3. Discover actions at runtime

typescript
// What can this app do?
for await (const action of zapier.listActions({ app: "notion" }).items()) {
  console.log(action.key, action.action_type, action.label);
}

// What inputs does an action need?
const { data: schema } = await zapier.getActionInputFieldsSchema({
  app: "notion",
  actionType: "search",
  action: "page_by_title",
});

Gotchas

  • OAuth cannot be automated. If no connection exists, create-connection opens a browser for the user. Agents must surface the URL and wait for the human. See "1. Find or create a connection" above.
  • is_hidden: true actions are not on the stable surface. They may work at runtime, but Zapier makes no promises they'll keep working. Filter them out of list-actions results before picking an action key.
  • Two connection reference shapes. At runtime, pass connection.id (UUID) to runAction. Inside a durable workflow (@zapier/zapier-durable), pass a string alias like "notion_primary" that the runtime resolves at deploy time. Don't mix them up.
  • runAction returns { data: T[] }, always an array. Search-style actions typically return one row; downstream code destructures data: [result]. Write actions also return an array (usually one element).
  • Dynamic input fields. Notion database properties, HubSpot custom fields, Jira per-project schemas: none of these are knowable ahead of time. Always run list-action-input-fields against the live connection before authoring.
  • App keys: the SDK's runAction wants the CLIAPI-suffixed form. In TypeScript, sdk.runAction({ appKey }) requires "NotionCLIAPI". Get it from list-apps or list-actions. Everywhere else (the CLI's run-action, sdk.findFirstConnection, sdk.listActions, and so on) accepts either the short slug ("notion") or the CLIAPI form.
  • Multiple connections per app is normal. Users often have several (personal + work Gmail, multiple Slack workspaces). Default to findFirstConnection / find-first-connection and take the first result. Don't stop to disambiguate unless the user explicitly asks; filter by title or owner if you need a specific one.
  • Vendor 429s reach your code. On run-action, upstream rate limits (Slack, HubSpot, Notion) come back as ZAPIER_ACTION_ERROR with a message ending ..., N) where N is Retry-After in seconds. Sleep N, then retry. Throttle bursts; don't rely on --max-network-retries to catch these.

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 (version-locked to the installed package, grep-able offline):

When paginating a list-* call, see references/pagination.md for the three patterns the SDK supports.

Authenticated HTTP (fetch)

Make raw API calls through Zapier's auth infrastructure when no first-class action exists:

typescript
const response = await zapier.fetch("https://api.example.com/data", {
  connection: connection.id,
  method: "GET",
});

Same auth and audit trail as runAction. Use this when the app's Zapier action catalog doesn't cover what you need (bulk reads, custom endpoints, partner-specific APIs).

Examples

For fill-in-the-blank skeletons (plain script, Zapier Table, durable workflow), see references/examples.md. These are shape-only; the real, action-key-verified corpus is at https://github.com/zapier/sdk/tree/main/examples. Grep the corpus by app or pattern when you need a working reference.

Full documentation

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Zapier Sdk AI 技能有什么作用?

适用于 TypeScript 的 Zapier SDK。通过 Zapier 的 OAuth 和审计层,代表用户以编程方式访问 9,000 多个应用。编写需要在第三方应用中执行操作的代码时使用,例如发送电子邮件、更新或插入 CRM 记录、查找电子表格行或在聊天中发帖,且无需管理各应用自己的 OAuth 或供应商 SDK。触发词:"zapier sdk"、"zapier-sdk"、"@zapier/zapier-sdk"、"runAction"、"run zapier action"、"connect to app via zapier"、"zapier connection"、"zapier tables"、"list actions for zapier app"、"getActionInputFieldsSchema"、"createZapierSdk"。

为什么在 TypingMind 中使用 Zapier Sdk?

因为您只需安装一次,就能搭配任何模型使用。Zapier Sdk 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Zapier Sdk?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/zapier/sdk/tree/main/skills/zapier-sdk。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Zapier Sdk?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Zapier Sdk 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Zapier Sdk 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Zapier Sdk AI 技能免费吗?

是的。zapier 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇