Webhooks

Community

Verified inbound webhooks (GitHub, Twitch EventSub, Stripe, Discord, Standard Webhooks) handled exactly once, and signed outbound webhooks from a transactional outbox with retries.

    npm i @pogly/spacetimedb-webhooks

    Both directions of webhooks, inside your module.

    Inbound: it receives events from GitHub, Twitch EventSub (including the verification challenge), Stripe, Discord interactions, any Standard Webhooks sender, or a generic HMAC signer. It checks signatures and replay windows, and deduplicates deliveries in the same transaction as your handler, so each event is applied exactly once.

    Outbound: you send your own events, signed per the Standard Webhooks spec, from a transactional outbox with retries, backoff and dead letters.

    • Use it when outside services need to push changes into your database, or your database needs to notify other systems: reacting to a Twitch follow or a Stripe payment in real time, syncing GitHub events, or telling your own backend that an order was paid.
    • Because sends go through the outbox, an event only goes out if the transaction that produced it commits.

    Mount it, then add one HTTP handler that calls webhooks.inbox(...) with your configured sources and an onEvent callback. The callback runs only for verified, first-time deliveries, inside the dedupe transaction. Throw to refuse an event, or return JSON to reply.

    For outbound, register endpoints with webhooks.addEndpoint(...) and call webhooks.send(ctx.as.webhooks, 'order.paid', {...}) from any reducer. A scheduled procedure delivers due messages and reschedules failures.

    Secrets come from environment variables, and every table is private. Routes, headers and behaviour match the Rust and C# versions.

    Related submodules

    IDC

    Databases that push messages to each other, with no polling: a transactional outbox, signed delivery that retries until it lands, and exactly-once apply on the other side. Rust and C# speak it too.

    Lethalchip0/wkCommunity

    Authz

    Roles, scopes and grants for multi-user modules: wildcard permissions, role inheritance, scope trees, expiring grants, invite links, an audit log and row-level security, with no privilege escalation.

    Lethalchip0/wkCommunity

    Cron

    Schedules recurring tasks in a SpacetimeDB module using calendar expressions or fixed intervals. Supports time zones, per-job arguments, failure limits, and runtime schedule changes.

    SpacetimeDB0/wk
    Submodule

    Edit details

    One short paragraph describing the submodule.

    A few bullets for scenarios where this is a good fit.

    A few short paragraphs at the conceptual level.