Skip to content

feat(webhooks): add typed endpoints and signature verification - #85

Merged
thedogwiththedataonit merged 12 commits into
mainfrom
codex/outbound-email-webhooks
Nov 11, 2026
Merged

thedogwiththedataonit merged 12 commits into
mainfrom
codex/outbound-email-webhooks

Conversation

@thedogwiththedataonit

@thedogwiththedataonit thedogwiththedataonit commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Add a typed brew.webhooks resource for brand-scoped endpoint CRUD, secret rotation, test delivery, event history, attempts and replay. Export event contracts and a local Svix-compatible signature verifier with typed failures. Documentation covers receiver verification, retry identity and retained-payload limits.

Rebased onto current main and regenerated types from the canonical app OpenAPI mirror, preserving main's array filters and resource fixes. Local webhook and contract parity checks pass (15 tests), along with typecheck and lint; CI runs the full package gates.

Coordinates with app #2398, CLI #75 and docs #363. Publish after the matching API deployment. This PR does not publish a package.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no new actionable issues found.

Summary

Adds typed brew.webhooks methods and local signature checks through verifyWebhook.

  • Developers can manage brand email webhooks and their delivery history through the SDK.
  • Receivers can check signed email events with a typed local verifier.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  App[Application] --> Methods[brew.webhooks methods]
  Methods --> HTTP[Shared HTTP client]
  HTTP --> API[Brew API]
  Delivery[Incoming webhook] --> Verify[verifyWebhook]
  Verify --> Checks[Check timestamp and signature]
  Checks --> Result[Return event or typed error]
Loading

Reviews (10) · Last reviewed commit: "Sync spec to brew-v2 main after webhooks..." · Reviewed by Greptile

Comment thread tests/webhooks.test.ts Resolved
@thedogwiththedataonit
thedogwiththedataonit force-pushed the codex/outbound-email-webhooks branch from e0db056 to 8310b56 Compare November 3, 2026 13:47
Resolve the spec conflict by syncing openapi/public-api-v1.yaml from brew-v2
main merged with GetBrew/brew-v2#2398, then regenerate the types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- verifyWebhook trusts the signature and accepts any signed event envelope,
  so a new event type or schema version never rejects real deliveries on an
  older SDK. BrewWebhookVerificationError carries a `reason`.
- `payload` accepts the raw bytes (a Node Buffer) as well as a string.
- `remove` is `delete`, like every other resource; `replay(webhookId,
  eventId)` takes its identities positionally.
- Docs: receivers answer 400 on verification errors, handle unknown types,
  and deduplicate on svix-id (test events share a fixture event_id).
- CHANGELOG and the error table list the new surface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated spec, types and snippets regenerated from brew-v2
codex/outbound-email-webhooks merged with main 5d0f0e828d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedogwiththedataonit
thedogwiththedataonit merged commit 75cdb73 into main Nov 11, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant