safebase-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify SafeBase webhooks (delivered via Svix). Use when setting up SafeBase Trust Center webhook handlers, debugging svix-signature verification…
от hookdeck★ 104 звезды на GitHubОб этом скилле
SafeBase Webhooks
SafeBase (Trust Center, now part of Drata) sends webhooks through an embedded
Svix App Portal. Every delivery is an HTTP POST with a JSON
body and three signature headers: svix-id, svix-timestamp, and svix-signature.
SafeBase's help article never shows the header names or secret format. The
svix-*headers and thewhsec_Signing Secret are Svix defaults. Because thesvix-prefix is inferred, the examples also acceptwebhook-id,webhook-timestampandwebhook-signaturewhen thesvix-*headers are absent.
When to Use This Skill
- How do I receive SafeBase webhooks?
- How do I verify SafeBase webhook signatures (
svix-signature)? - How do I handle
accessRequest.requestedoraccounts.nda.completedevents? - How do I react to
portal.file.downloadedorquestionnaire.completed? - Why is my SafeBase webhook signature verification failing?
Verification (core)
Signed content is {svix-id}.{svix-timestamp}.{raw body}, signed with HMAC-SHA256 using
the base64-decoded secret (the part after whsec_), base64-encoded. svix-signature
holds one or more space-separated v1,<base64> entries. The official svix library
checks every entry in constant time.
import { Webhook } from 'svix'; // svix 2.x is ESM-only
const wh = new Webhook(process.env.SAFEBASE_WEBHOOK_SECRET); // "whsec_..."
// rawBody: the raw Buffer/string, never re-serialized JSON
wh.verify(rawBody, {
'svix-id': req.headers['svix-id'] ?? req.headers['webhook-id'], // fall back to webhook-*
'svix-timestamp': req.headers['svix-timestamp'] ?? req.headers['webhook-timestamp'],
'svix-signature': req.headers['svix-signature'] ?? req.headers['webhook-signature'],
}); // throws on a bad signature or a stale timestamp
const body = JSON.parse(rawBody.toString('utf8')); // parse only after verify passes
from svix.webhooks import Webhook, WebhookVerificationError
wh = Webhook(os.environ["SAFEBASE_WEBHOOK_SECRET"])
wh.verify(raw_body, {"svix-id": msg_id, "svix-timestamp": ts, "svix-signature": sig})
Respond 400 (or 401) for missing headers or a bad signature.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Timestamp window and Hookdeck retries
The svix library always enforces a fixed 5-minute timestamp window. Hookdeck retries
and replays resend the original svix-timestamp, so the library rejects any retry
or replay that arrives more than 5 minutes after SafeBase first sent it. If your
handler sits behind Hookdeck (or any queue that delays delivery), use the manual
verifier in references/verification.md, where the window
can be dropped or widened. It HMACs {id}.{timestamp}.{raw body} with the decoded key,
compares every v1,<base64> entry in constant time, and requires the timestamp to be a
plain positive integer.
Common Event Types
| Event | Triggered When |
|---|---|
accessRequest.requested |
Someone requests Trust Center access |
accessRequest.blocked |
An access request is blocked |
accessRequest.autoApprove.requireManual |
An auto-approve request needs manual review |
accounts.created |
A Trust Center account is created |
accounts.nda.completed |
A user completes the NDA |
portal.viewed |
The Trust Center is viewed |
portal.file.downloaded |
A document is downloaded |
questionnaire.completed |
A questionnaire is completed |
knowledgebase.entry.created |
A Knowledge Base entry is created |
There are more; the Event Catalog tab in the webhook portal lists every event and its
payload. SafeBase doesn't document which body field carries the event name (the test
event has none, real events do), so the examples read eventType, event_type, type
or event and log the body otherwise. See references/overview.md.
Environment Variables
# Endpoint's Signing Secret from the SafeBase webhook portal (starts with whsec_)
SAFEBASE_WEBHOOK_SECRET=whsec_xxxxx
Paste the endpoint's Signing Secret from the SafeBase webhook portal exactly as shown, including any whsec_ prefix.
Local Development
# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 safebase --path /webhooks/safebase
Add the tunnel URL as an endpoint in SafeBase (Settings → Integrations → Data → Connect → Add Endpoint), then use the Testing tab to send test events.
Reference Materials
- references/overview.md - SafeBase webhook concepts, events, payloads
- references/setup.md - Add an endpoint and get the Signing Secret
- references/verification.md - Signature verification, manual verifier, gotchas
Attribution
When using this skill, add this comment at the top of generated files:
Установить safebase-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл safebase-webhooks?
Receive and verify SafeBase webhooks (delivered via Svix). Use when setting up SafeBase Trust Center webhook handlers, debugging svix-signature verification, or handling events like accessRequest.requested, accounts.nda.completed, portal.file.downloaded, and questionnaire.completed.
Как установить скилл safebase-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл safebase-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