Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

kontent-ai-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify Kontent.ai webhooks. Use when creating webhooks in Environment settings, verifying the X-Kontent-ai-Signature header (base64 HMAC-SHA256 of…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Kontent.ai Webhooks

Kontent.ai sends a JSON POST to your webhook URL when content items, assets, content types, languages or taxonomies change. You create webhooks in Environment settings > Webhooks or with the Management API. Each webhook watches either published or preview data.

When to Use This Skill

  • How do I receive Kontent.ai webhooks?
  • How do I verify X-Kontent-ai-Signature?
  • Do I base64-decode the webhook Secret? (no)
  • Why does Kontent.ai's helper rewrite line breaks, and do I need to?
  • What's X-KC-Signature?

Verification (core)

Kontent.ai's webhook docs: the X-Kontent-ai-Signature value "is a base64-encoded hash generated using an HMAC-SHA-256 with the webhook's secret key", computed over "the raw JSON body of the webhook payload".

Part Value
Header X-Kontent-ai-Signature
Value Base64 HMAC-SHA256 (44 characters), no prefix
Key The webhook's Secret (Environment settings > Webhooks > your webhook > Settings > Secret), used as text
Signed content The raw request body
const crypto = require('crypto');

function verifyKontentAiSignature(rawBody, signature, secret) {   // rawBody: exact bytes
  const value = String(signature || '').trim();
  if (!secret || !/^[A-Za-z0-9+/]{43}=$/.test(value)) return false;
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest();
  return crypto.timingSafeEqual(Buffer.from(value, 'base64'), expected);
}
  • Secret as text. The Secret looks like base64. Use the string itself as the key. Each webhook has its own Secret.
  • Line endings. Kontent.ai's JS helper (@kontent-ai/webhook-helper) rewrites every run of line breaks to CRLF before hashing. That repairs bodies whose line endings were changed after receipt, for example by copying a payload out of a request viewer. If you hash the bytes exactly as received (as the .NET helper and these examples do), you don't need it. Just make sure nothing in front of your handler rewrites the body.
  • Legacy header. Older webhooks may send X-KC-Signature instead. The examples, and the Kontent.ai source type in Hookdeck, check only X-Kontent-ai-Signature. Recreate an old webhook to get the current header, or in Hookdeck use the generic HMAC source type (SHA-256, base64, header x-kc-signature).
  • Bad or missing signature: 401. Secret not set: 500.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Python uses hmac.new(secret.encode(), raw_body, hashlib.sha256), base64.b64decode and hmac.compare_digest. See references/verification.md.

Hookdeck: the Kontent.ai source type (KONTENT_AI) verifies X-Kontent-ai-Signature. Paste the webhook's Secret as-is. Webhooks that send only the legacy X-KC-Signature aren't covered: recreate the webhook, or use the generic HMAC source type (SHA-256, base64, header x-kc-signature). Verification is optional on the source, and Hookdeck applies no timestamp window.

Payload

{
  "notifications": [
    {
      "data": {
        "system": {
          "id": "32022d85-...",
          "name": "This changes everything!",
          "codename": "this_changes_everything",
          "collection": "marketing",
          "workflow": "default",
          "workflow_step": "published",
          "language": "english",
          "type": "product_update",
          "last_modified": "2024-01-08T13:54:54.3153716Z"
        }
      },
      "message": {
        "environment_id": "5f313984-...",
        "object_type": "content_item",
        "action": "published",
        "delivery_slot": "published"
      }
    }
  ]
}

A notification names only the directly changed object, not its content. Fetch fresh content from the Delivery API (send X-KC-Wait-For-Loading-New-Content: true to skip stale cache). Notifications can arrive in batches.

Event Types

An event is message.object_type plus message.action:

object_type Actions
content_item (published data) published, unpublished, metadata_changed
content_item (preview data) created, changed, deleted, workflow_step_changed (with action_context), metadata_changed
asset created, changed, deleted, metadata_changed
content_type created, changed, deleted
language created, changed, deleted
taxonomy created, metadata_changed, deleted, term_created, term_changed, term_deleted, terms_moved

Environment Variables

KONTENT_AI_WEBHOOK_SECRET=your-webhook-secret   # Environment settings > Webhooks > your webhook > Settings > Secret

Local Development

# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 konte
Полный SKILL.md на GitHub

Установить kontent-ai-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/kontent-ai/route.tsexamples/nextjs/lib/verify-kontent-ai.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл kontent-ai-webhooks?

Receive and verify Kontent.ai webhooks. Use when creating webhooks in Environment settings, verifying the X-Kontent-ai-Signature header (base64 HMAC-SHA256 of the raw body keyed with the webhook Secret), debugging signature mismatches (line endings, the legacy X-KC-Signature header), or handling content item, asset, content type, language and taxonomy notifications.

Как установить скилл kontent-ai-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл kontent-ai-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить kontent-ai-webhooks с