Skip to content

Add outbound webhooks - #1

Merged
rusenask merged 1 commit into
mainfrom
outbound-webhooks
Sep 27, 2026
Merged

rusenask merged 1 commit into
mainfrom
outbound-webhooks

Conversation

@rusenask

@rusenask rusenask commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Adds the outbound webhooks API (/v1/outbound, pilot) to the SDK as relay.outbound: send signed webhooks to your own customers.

  • Consumers and event types: relay.outbound.consumers.upsert, relay.outbound.eventTypes.upsert, plus list/get/delete.
  • Endpoints: relay.outbound.endpoints.create (returns the signing secret), update, pause/resume, rotateSecret/revealSecret, and deliveries. retry/recover/replayMissing start a background recovery task.
  • Messages: relay.outbound.messages.publish(params, { idempotencyKey }), get (with deliveries and attempts), list. relay.outbound.recoveryTasks.get reports recovery progress.
  • Endpoint and message params accept camelCase (eventTypes, autoDisable, functionId, eventType, eventId) as well as snake_case.
  • examples/outbound.ts is a runnable example. test/outbound.test.ts runs it, and the Webhook Relay dashboard shows its marked region as the TypeScript snippet.
  • swagger/swagger.yaml and src/generated/api.ts are regenerated from the backend branch that adds these endpoints. Most of that diff is swagger drift that had built up since the last refresh.
  • make openapi now calls npm run openapi. It used to pass --extract-request-params, which generates a client the existing resources don't compile against.

Keep this as a draft, and don't publish a release, until the backend change (rusenask/webhookrelay#1073) is deployed; the endpoints don't exist in production before that.

Checks run locally: npm run typecheck, npm test (62 tests), npm run build, and a typecheck of examples/outbound.ts.

🤖 Generated with Claude Code


Note

Medium Risk
Large new API surface touching signing secrets and idempotency, but changes are additive and depend on backend deployment before production use.

Overview
Adds outbound webhooks (pilot /v1/outbound) to the public SDK as relay.outbound, so apps can register customer consumers/endpoints, publish signed events, and inspect or recover deliveries.

The new facade in src/resources/outbound.ts covers consumers, event types, endpoints (create with signing secret, pause/resume, secret rotate/reveal, deliveries, retry/recover/replayMissing), messages (publish with optional Idempotency-Key), and recovery tasks. Request params accept camelCase via new helpers in params.ts; response types live in types.ts. WebhookRelay and the package barrel export the resource classes.

Docs and examples: README section, AGENTS.md layout notes, runnable examples/outbound.ts (dashboard snippet region), and test/outbound.test.ts asserting HTTP paths/bodies. Vitest resolves @webhookrelay/sdk to source so tests can import the example.

Build: make openapi now runs npm run openapi instead of invoking swagger-typescript-api directly (drops --extract-request-params, which broke the hand-written resources against the generated client).

Reviewed by Cursor Bugbot for commit b822b13. Configure here.

relay.outbound.{consumers,eventTypes,endpoints,messages,recoveryTasks}
for the /v1/outbound API, with camelCase aliases for endpoint and message
params, and examples/outbound.ts, which the tests run and the Webhook Relay
dashboard shows as its TypeScript snippet.

Regenerates the swagger and generated client from the backend. make openapi
now runs npm run openapi: it passed --extract-request-params, which
generates a client that the resources don't compile against.
@rusenask
rusenask marked this pull request as ready for review September 27, 2026 10:55
@rusenask
rusenask merged commit 984d316 into main Sep 27, 2026
4 checks passed
@cursor

cursor Bot commented Sep 27, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_96bc4eaa-53a4-47d5-bb60-3f0eb1be3605)

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