@team-plain/webhooks package provides typed webhook parsing and HMAC-SHA256 signature verification. It is a standalone package with no dependency on @team-plain/graphql.
Installation
Verify and parse (recommended)
verifyPlainWebhook validates the HMAC-SHA256 signature, checks the timestamp to prevent replay attacks, and parses the payload against the webhook JSON schema.
tolerance (default: 300 seconds) controls the maximum allowed age of the webhook timestamp.
Parse only (no signature verification)
parsePlainWebhook validates the payload against the webhook JSON schema without checking the signature. Useful for development or when verification is handled elsewhere.
Error types
All functions return aResult<T, Error> — either { data: T } or { error: Error }.
| Error class | When |
|---|---|
PlainWebhookSignatureVerificationError | Invalid signature, missing headers, or expired timestamp |
PlainWebhookPayloadError | Payload fails JSON schema validation |
PlainWebhookVersionMismatchError | Payload version doesn’t match the schema version bundled in this package |
Typed event payloads
All webhook payload types are exported for use in your handlers:Resources
- Webhooks overview — setup, security, delivery semantics, and retry policy
- Request signing — how Plain signs webhook requests
- GitHub repository

