Skip to main content
The @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

verifyPlainWebhook validates the HMAC-SHA256 signature, checks the timestamp to prevent replay attacks, and parses the payload against the webhook JSON schema.
The optional fourth argument 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 a Result<T, Error> — either { data: T } or { error: Error }.

Typed event payloads

All webhook payload types are exported for use in your handlers:
See the full list of webhook events for all available event types.

Resources