Repository navigation
Customer webhooks on @profullstack/webhooks 0.2.1 - #38
Merged
Merged
Conversation
Signed webhooks (Standard Webhooks headers, CloudEvents body) for every
account, with the hub's durable outbox in this site's Postgres.
- Events: server.listed and server.price_dropped (offers matching one of the
account's saved searches, from each mirror tick; a drop is a cut in the
billed-in price, never an FX move), pass.granted (credit code or invite),
api_key.created, api_key.revoked (never the key itself).
- Store: postgresStore over a 3-line Bun.SQL adapter (sql.unsafe), tables
from migration 0004 (schemaSql('pg')). hooks.start() once at boot.
- /api/v1/webhooks behind the existing key/session auth; settings panel
(add with events, test, pause, rotate, remove, secret shown once, recent
deliveries); `r4ck webhooks` (CLI 0.3.0); MCP list/create/update/delete/
test_webhook, rotate_webhook_secret, webhook_deliveries.
- Account deletion removes the account's endpoints and log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…eb's dependency) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer webhooks for r4ck.dev accounts, on
@profullstack/webhooks0.2.1 (pinned exactly).Events (owner = the account)
server.listed{ saved_search, total, servers[≤50] }, subjectsaved_search:<id>server.price_droppedprice_beforepass.granted{ days, source, until }api_key.created/api_key.revoked{ id, name, prefix }/{ id }, never the keyOne event per saved search and type per tick. Only accounts with an enabled endpoint are matched.
How
apps/web/src/lib/webhooks.js:postgresStoreover a Bun.SQL adapter (query(text, params) -> { rows: await sql.unsafe(text, params) }), tested against Postgres. Tables in migration0004_webhooks.sql(the package'sschemaSql('pg')), runs on boot.hooks().start()once inmain.js.syncTick({ onChanges })collects what each tick listed and cut;upsertServernow also returns the previous billed-in price. The daemon passes it tonotifyWatchers./api/v1/webhooks(+/*) behind the existing auth (session orr4k_key; 401 otherwise).r4ck webhooks [list|add|update|rm|test|rotate|secret|deliveries|retry], version 0.3.0.list_webhooks,create_webhook,update_webhook,delete_webhook,test_webhook,rotate_webhook_secret,webhook_deliveries.No existing outbound webhooks, so nothing to migrate.
Tests
test/webhooks.test.js(adapter, 401/200/400/201, api_key.created verified withverifySignature, listed → same price → drop → rise → paused through a realsyncTick, MCP, settings form) and a CLI test. Deliveries go to a stub fetch.🤖 Generated with Claude Code