Command Palette

Search for a command to run...

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

memos-webhooks

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

Receive and verify Memos (usememos.com) webhooks, which follow the Standard Webhooks specification when the webhook has a whsec_ signing secret. Use when…

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

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

Memos Webhooks

Memos is an open-source, self-hosted note-taking app. Each user can add webhooks in Settings, and Memos POSTs a JSON event to the URL when a memo is created, updated, deleted or commented on. Since v0.30.0 deliveries are signed in the Standard Webhooks format (webhook-id, webhook-timestamp, webhook-signature) whenever the webhook has a signing secret.

When to Use This Skill

  • How do I receive Memos webhooks?
  • How do I verify a Memos webhook signature (webhook-signature)?
  • Where do I find my Memos webhook secret (whsec_...)?
  • Why does Memos report my webhook as failed when I return 200 OK?
  • How do I handle memos.memo.created, memos.memo.updated, memos.memo.deleted or memos.memo.comment.created events?
  • Why is my Memos webhook arriving unsigned, or failing verification only on retries and replays?

Required Response and Configuration Alert

Memos treats any response that is not 2xx with a JSON body whose code is 0 as a failed delivery. A plain 200 OK with an empty body fails. Every accepted delivery must be answered with HTTP 200 and {"code":0} (the examples do this). The Hookdeck configuration alert for this source reads:

"Generate a signing secret in the Memos webhook edit dialog. Older webhooks are unsigned until you do. Memos treats any response without JSON {"code":0} as failed, so set a custom response with body {"code":0} on this source."

So if you receive through Hookdeck, set a custom response with body {"code":0} on the source. Signing is conditional: Memos only signs when the webhook has a secret. New webhooks get one; older webhooks are unsigned until you generate a secret in the edit dialog. Fail closed in your handler when MEMOS_WEBHOOK_SECRET is not set.

Verification (core)

Header Value
webhook-id Unique message ID beginning with msg_. Your idempotency key (the body has no event id)
webhook-timestamp Unix seconds
webhook-signature One or more space-separated v1,<base64> entries

Signed content is {webhook-id}.{webhook-timestamp}.{raw body}, HMAC-SHA256, base64 output. For a whsec_... secret the key is the base64-decoded part after the prefix; Memos uses any other secret value as its raw bytes. Compare against every v1, entry and ignore other versions. If webhook-id is absent, read svix-id, svix-timestamp and svix-signature instead. The examples use the standardwebhooks library (npm and PyPI):

const { Webhook } = require('standardwebhooks');

// rawBody: exact request body (Buffer or string), NOT re-serialised JSON
function verifyMemos(rawBody, headers, secret = process.env.MEMOS_WEBHOOK_SECRET) {
  const p = headers['webhook-id'] ? 'webhook' : 'svix'; // fall back to the svix-* names
  const wh = secret.startsWith('whsec_')
    ? new Webhook(secret)
    : new Webhook(Buffer.from(secret, 'utf8'), { format: 'raw' }); // non-whsec_ secret = raw bytes
  wh.verify(rawBody, {
    'webhook-id': headers[`${p}-id`],
    'webhook-timestamp': headers[`${p}-timestamp`],
    'webhook-signature': headers[`${p}-signature`],
  }, { jsonParse: false }); // throws on a bad signature or stale timestamp → respond 401
}

The library always enforces a fixed 5-minute timestamp window. Hookdeck retries and replays resend the original webhook-timestamp, so the library rejects them once they are more than 5 minutes old. If you receive through Hookdeck and need late retries to pass, use the manual verifier in references/verification.md, which can drop or widen the window. In Express, read the body with express.raw({ type: '*/*' }) so any content type verifies, and parse JSON only after the check.

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

Event Type and Payload

Memos sends Content-Type: application/json with a JSON object of four fields, and the event name is the top-level activityType:

Field Meaning
url The destination URL the webhook was sent to
activityType The event name. Route on this
creator The memo creator's resource name, users/{user}
memo The affected memo, in the API's Memo shape. On comment-created events this is the comment; from 26.11.2 read memo.parent for the memo it replies to (earlier releases put it in memo.relations)

The docs name activityType, creator and the affected memo; url and the users/{user} format come from Memos's source. Memos publishes no example body and the docs don't list the fields inside memo, so the examples read only activityType and creator. The activityType values below are the strings the 26.11.2 dispatchers pass (unchanged since v0.31.0).

Common Event Typ

Полный SKILL.md на GitHub

Установить memos-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/memos/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and verify Memos (usememos.com) webhooks, which follow the Standard Webhooks specification when the webhook has a whsec_ signing secret. Use when setting up a Memos webhook endpoint, debugging webhook-id / webhook-timestamp / webhook-signature verification, replying with the required {"code":0} body, or handling memos.memo.created, memos.memo.updated, memos.memo.deleted and memos.memo.comment.created events.

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

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

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

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

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

Сравнить memos-webhooks с