planetscale-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify PlanetScale webhooks. Use when setting up PlanetScale webhook handlers, debugging X-PlanetScale-Signature verification, or handling…
от hookdeck★ 104 звезды на GitHubОб этом скилле
PlanetScale Webhooks
When to Use This Skill
- How do I receive PlanetScale webhooks?
- How do I verify the
X-PlanetScale-Signatureheader? - How do I handle
branch.ready,deploy_request.opened,backup.failedorcluster.storageevents (notify Slack, update a ticket, run CI on schema changes)? - Why is my PlanetScale webhook signature verification failing (the docs' JavaScript sample uses
JSON.stringify(req.body))?
Verification (core)
PlanetScale signs the raw request body with HMAC-SHA256, keyed with the webhook's secret, and sends the bare hex digest in X-PlanetScale-Signature. There is no sha256= prefix, no timestamp and no list of signatures: compare the whole header value as one digest.
- The HMAC key is the secret's UTF-8 bytes, used as-is (not hex- or base64-decoded).
- Sign bytes: the body exactly as received. Never
JSON.parse/JSON.stringifybefore verifying (the docs' JavaScript sample doesJSON.stringify(req.body), which does not match byte-for-byte; the Python sample uses the raw body, and so should you). - Require exactly 64 hex characters before decoding (
Buffer.from(x, 'hex')silently drops bad characters), then compare in constant time. Hex is case-insensitive.
Node:
const crypto = require('crypto');
function verify(rawBody, signatureHeader, secret) {
if (typeof signatureHeader !== 'string' || !secret) return false;
if (!/^[0-9a-f]{64}$/i.test(signatureHeader)) return false;
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest();
return crypto.timingSafeEqual(Buffer.from(signatureHeader, 'hex'), expected);
}
Python (compare bytes so a non-ASCII header returns 401, not a 500):
import hmac, hashlib, re
def verify(raw_body: bytes, signature_header: str, secret: str) -> bool:
if not signature_header or not secret:
return False
if not re.fullmatch(r"[0-9a-fA-F]{64}", signature_header):
return False
expected = hmac.new(secret.encode("utf-8"), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(signature_header.lower().encode("utf-8"), expected.encode("utf-8"))
Missing, empty or malformed header, or a mismatch: respond 401. In Express use express.raw({ type: '*/*' }) so the body stays a Buffer whatever the content type.
For complete handlers with route wiring, event dispatch, and tests, see:
Common Event Types
The event name is the body's top-level event field (there is no event-name header). timestamp (Unix seconds), organization, database and resource (the resource's API representation) sit beside it.
| Event | Fires when |
|---|---|
webhook.test |
You click Test webhook (one test every 20 seconds) |
branch.ready |
A branch is created and ready to connect |
branch.anomaly |
A branch has a new anomaly in Insights |
deploy_request.opened |
A deploy request is opened |
deploy_request.queued |
A deploy request is added to the deploy queue |
deploy_request.in_progress |
A deploy request has started running |
backup.failed |
A backup failed |
backup.succeeded |
A backup completed |
cluster.storage |
A Postgres database reached a storage threshold (60/75/85/90/95%) |
database.access_request |
PlanetScale staff opens an access request |
PlanetScale documents 26 events in total, including branch.primary_promoted, branch.out_of_memory, branch.schema_recommendation, branch.sleeping, branch.start_maintenance, deploy_request.pending_cutover, deploy_request.schema_applied, deploy_request.errored, deploy_request.reverted, deploy_request.closed, keyspace.storage and five Postgres maintenance events (maintenance.scheduled, maintenance.started, maintenance.completed, maintenance.failed, maintenance.canceled). See references/overview.md.
For the full event reference, see PlanetScale webhook events.
Important Headers
| Header | Description |
|---|---|
X-PlanetScale-Signature |
Hex HMAC-SHA256 of the raw body, keyed with the webhook secret |
Authorization |
Only if you configured one on the webhook; sent unchanged. Authenticates PlanetScale to you and does not replace the signature |
Delivery Behaviour
Respond 2xx within 2 seconds or the delivery is marked failed; redirects are not followed; webhooks that repeatedly fail are disabled. No retry policy is documented, so do the work asynchronously and make side effects idempotent. There is no event or delivery ID, and storage events carry no resource.id, so compare the resource's state (resource.state, updated_at) with what you've stored rather than relying on a composite key. Each database can have up to 5 webhooks. Deliveries come from `3.2
Установить planetscale-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл planetscale-webhooks?
Receive and verify PlanetScale webhooks. Use when setting up PlanetScale webhook handlers, debugging X-PlanetScale-Signature verification, or handling branch.ready, deploy_request.opened, backup.failed and cluster.storage events from PlanetScale (managed Vitess and Postgres).
Как установить скилл planetscale-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл planetscale-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic