jpskill.com
🛠️ 開発・MCP コミュニティ

webflow-webhooks

WebflowのWebフックを受信・検証し、フォーム送信やサイト公開、EC注文などのイベント処理を効率化するSkill。

📜 元の英語説明(参考)

Receive and verify Webflow webhooks. Use when setting up Webflow webhook handlers, debugging signature verification, or handling Webflow events like form_submission, site_publish, ecomm_new_order, or collection item changes.

🇯🇵 日本人クリエイター向け解説

一言でいうと

WebflowのWebフックを受信・検証し、フォーム送信やサイト公開、EC注文などのイベント処理を効率化するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Webflow Webhook

フォーム送信、CMSの変更、Eコマースの注文、サイト公開など、WebflowのWebhookイベントを受信、検証、処理します。

クイックスタートワークフロー

前提条件: アクティブなサイトを持つWebflowアカウントが必要です。署名検証のためには、API経由でWebhookを作成してください(ダッシュボードからではありません) — セットアップをご覧ください。

  1. Webhookの作成: 目的のイベントタイプについてWebflow API経由でWebhookを登録します。
  2. イベントの受信: 生のボディ解析を伴うPOSTリクエストを受け入れるエンドポイントを設定します。
  3. 署名の検証: x-webflow-signatureおよびx-webflow-timestampヘッダーを検証します。
  4. イベントの処理: triggerTypeによってイベントをルーティングし、それぞれ適切に処理します。
  5. 確認応答: 受信を確認するために200を返します(他のステータスは再試行をトリガーします)。

署名検証

const crypto = require('crypto');

function verifyWebflowSignature(rawBody, signature, timestamp, secret) {
  // リプレイ攻撃を防ぐためのタイムスタンプチェック(5分間ウィンドウ - 300000ミリ秒)
  const currentTime = Date.now();
  if (Math.abs(currentTime - parseInt(timestamp)) > 300000) {
    return false;
  }

  // HMAC署名の生成
  const signedContent = `${timestamp}:${rawBody}`;
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(signedContent)
    .digest('hex');

  // タイミングセーフな比較
  try {
    return crypto.timingSafeEqual(
      Buffer.from(signature),
      Buffer.from(expectedSignature)
    );
  } catch {
    return false; // 長さが異なる場合は無効
  }
}

イベントの処理

app.post('/webhooks/webflow', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.headers['x-webflow-signature'];
  const timestamp = req.headers['x-webflow-timestamp'];

  if (!signature || !timestamp) {
    return res.status(400).send('Missing required headers');
  }

  const isValid = verifyWebflowSignature(
    req.body.toString(),
    signature,
    timestamp,
    process.env.WEBFLOW_WEBHOOK_SECRET
  );

  if (!isValid) {
    return res.status(400).send('Invalid signature');
  }

  const event = JSON.parse(req.body);

  switch (event.triggerType) {
    case 'form_submission':
      console.log('New form submission:', event.payload.data);
      break;
    case 'ecomm_new_order':
      console.log('New order:', event.payload);
      break;
    case 'collection_item_created':
      console.log('New CMS item:', event.payload);
      break;
    case 'collection_item_published':
      console.log('Published CMS items:', event.payload.items);
      break;
  }

  res.status(200).send('OK');
});

イベントタイプ

Webflowは、フォーム、サイト、ページ、Eコマース、CMS、コメントの6つのカテゴリにわたる14のWebhookイベントタイプをサポートしています。すべてのペイロードスキーマと例を含む完全なリファレンスについては、references/event-types.mdをご覧ください。

カテゴリ イベント 必須スコープ
フォーム form_submission forms:read
サイト site_publish sites:read
ページ page_created, page_metadata_updated, page_deleted pages:read
Eコマース ecomm_new_order, ecomm_order_changed, ecomm_inventory_changed ecommerce:read
CMS collection_item_created, collection_item_changed, collection_item_deleted, collection_item_unpublished, collection_item_published cms:read
コメント comment_created comments:read

環境変数

# OAuthアプリ経由で作成されたWebhookの場合
WEBFLOW_WEBHOOK_SECRET=your_oauth_client_secret

# API経由で作成されたWebhookの場合(2025年4月以降)
WEBFLOW_WEBHOOK_SECRET=whsec_xxxxx  # Webhook作成時に返されます

ベストプラクティス

  1. 常に署名を検証する: OAuthまたはAPI経由で作成されたWebhookにはHMAC-SHA256検証を使用します — 検証をご覧ください。
  2. 検証には生のボディを使用する: 解析されたJSONに対して検証を行わないでください。それに応じてフレームワークを設定してください。
  3. タイムスタンプを検証する: リプレイ攻撃を防ぐために5分間のウィンドウ(300000ms)を強制します。
  4. 200を迅速に返す: 受信を直ちに確認応答し、負荷の高いワークロードの場合はイベントを非同期で処理します。
  5. 再試行を適切に処理する: Webflowは失敗時に最大3回(10分間隔)再試行します — 冪等性を実装してください。
  6. 本番環境ではHTTPSを使用する: WebhookエンドポイントはセキュリティのためにHTTPSを使用する必要があります。

重要な注意事項

  • シークレットをプレーンテキストで扱わないでください。 APIトークン、OAuthクライアントシークレット、およびWebhook署名シークレットは、常に環境変数またはシークレットマネージャーに保存する必要があります。ユーザーにトークンやシークレットを直接尋ねたり、ソースファイルにハードコードしたりしないでください。
  • Webflowダッシュボードを通じて作成されたWebhookには、署名ヘッダーは含まれません。
  • OAuthアプリまたはAPI経由で作成されたWebhookのみがx-webflow-signatureおよびx-webflow-timestampを含みます。
  • リプレイ攻撃を防ぐために、タイムスタンプ検証(5分間ウィンドウ - 300000ミリ秒)は非常に重要です。
  • 受信を確認するために200ステータスを返します。他のステータスは再試行をトリガーします(最大3回、10分間隔)。

リファレンスドキュメント

各リファレンスファイルには、検索可能性のためにnamedescriptiontagsを含むYAMLフロントマターが含まれています。scripts/search_references.pyで利用可能な検索スクリプトを使用して、タグまたはキーワードで関連するリファレンスをすばやく見つけることができます。

  • references/event-types.md: スコープ、ペイロードスキーマ、および例を含む、全14イベントタイプの完全なリファレンス
  • references/webhook-api.md: Webhookの作成、リスト表示、取得、削除のためのREST API v2エンドポイント
  • references/overview.md: Webhookの概念、配信動作、制限、およびセキュリティに関する考慮事項
  • references/setup.md: ダッシュボードとAPIの設定、OAuth、スコープ、環境設定
  • references/verification.md: HMAC-SHA256署名検証、よくある落とし穴、デバッグ
  • [reference
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Webflow Webhooks

Receive, verify, and process Webflow webhook events for form submissions, CMS changes, ecommerce orders, site publishing, and more.

Quick Start Workflow

Prerequisite: You need a Webflow account with an active site. For signature verification, create webhooks via the API (not the dashboard) — see Setup.

  1. Create webhook: Register a webhook via the Webflow API for your desired event type
  2. Receive events: Set up an endpoint that accepts POST requests with raw body parsing
  3. Verify signatures: Validate x-webflow-signature and x-webflow-timestamp headers
  4. Process events: Route events by triggerType and handle each accordingly
  5. Acknowledge: Return 200 to confirm receipt (other statuses trigger retries)

Signature Verification

const crypto = require('crypto');

function verifyWebflowSignature(rawBody, signature, timestamp, secret) {
  // Check timestamp to prevent replay attacks (5 minute window - 300000 milliseconds)
  const currentTime = Date.now();
  if (Math.abs(currentTime - parseInt(timestamp)) > 300000) {
    return false;
  }

  // Generate HMAC signature
  const signedContent = `${timestamp}:${rawBody}`;
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(signedContent)
    .digest('hex');

  // Timing-safe comparison
  try {
    return crypto.timingSafeEqual(
      Buffer.from(signature),
      Buffer.from(expectedSignature)
    );
  } catch {
    return false; // Different lengths = invalid
  }
}

Processing Events

app.post('/webhooks/webflow', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.headers['x-webflow-signature'];
  const timestamp = req.headers['x-webflow-timestamp'];

  if (!signature || !timestamp) {
    return res.status(400).send('Missing required headers');
  }

  const isValid = verifyWebflowSignature(
    req.body.toString(),
    signature,
    timestamp,
    process.env.WEBFLOW_WEBHOOK_SECRET
  );

  if (!isValid) {
    return res.status(400).send('Invalid signature');
  }

  const event = JSON.parse(req.body);

  switch (event.triggerType) {
    case 'form_submission':
      console.log('New form submission:', event.payload.data);
      break;
    case 'ecomm_new_order':
      console.log('New order:', event.payload);
      break;
    case 'collection_item_created':
      console.log('New CMS item:', event.payload);
      break;
    case 'collection_item_published':
      console.log('Published CMS items:', event.payload.items);
      break;
  }

  res.status(200).send('OK');
});

Event Types

Webflow supports 14 webhook event types across 6 categories: Forms, Site, Pages, Ecommerce, CMS, and Comments. See references/event-types.md for the complete reference with all payload schemas and examples.

Category Events Required Scope
Forms form_submission forms:read
Site site_publish sites:read
Pages page_created, page_metadata_updated, page_deleted pages:read
Ecommerce ecomm_new_order, ecomm_order_changed, ecomm_inventory_changed ecommerce:read
CMS collection_item_created, collection_item_changed, collection_item_deleted, collection_item_unpublished, collection_item_published cms:read
Comments comment_created comments:read

Environment Variables

# For webhooks created via OAuth App
WEBFLOW_WEBHOOK_SECRET=your_oauth_client_secret

# For webhooks created via API (after April 2025)
WEBFLOW_WEBHOOK_SECRET=whsec_xxxxx  # Returned when creating webhook

Best Practices

  1. Always verify signatures: Use HMAC-SHA256 verification for webhooks created via OAuth or API — see Verification
  2. Use raw body for verification: Never verify against parsed JSON; configure your framework accordingly
  3. Validate timestamps: Enforce a 5-minute window (300000ms) to prevent replay attacks
  4. Return 200 quickly: Acknowledge receipt immediately; process events asynchronously for heavy workloads
  5. Handle retries gracefully: Webflow retries up to 3 times on failure (10-minute intervals) — implement idempotency
  6. Use HTTPS in production: Webhook endpoints must use HTTPS for security

Important Notes

  • Never handle secrets in plain text. API tokens, OAuth client secrets, and webhook signing secrets must always be stored in environment variables or a secrets manager. Never ask the user for tokens or secrets directly, and never hard-code them in source files.
  • Webhooks created through the Webflow dashboard do NOT include signature headers
  • Only webhooks created via OAuth apps or API include x-webflow-signature and x-webflow-timestamp
  • Timestamp validation (5 minute window - 300000 milliseconds) is critical to prevent replay attacks
  • Return 200 status to acknowledge receipt; other statuses trigger retries (up to 3 times, 10-minute intervals)

Reference Documentation

Each reference file includes YAML frontmatter with name, description, and tags for searchability. Use the search script available in scripts/search_references.py to quickly find relevant references by tag or keyword.

Searching References

# List all references with metadata
python scripts/search_references.py --list

# Search by tag (exact match)
python scripts/search_references.py --tag <tag>

# Search by keyword (across name, description, tags, and content)
python scripts/search_references.py --search <query>

Scripts

  • scripts/search_references.py: Search reference files by tag, keyword, or list all with metadata