Web & Protocols · zero-dependency · MIT

larzdispatch

One backend, N merchant apps, each with its own signed webhook.

A multi-tenant outbound webhook registry: register N destinations, each its own URL and signing secret, then send() looks one up by key, signs the payload, POSTs it, and reports whether it actually landed - true only on a real HTTP 200. Ported from a real production payment router that credits several different merchant apps from one shared backend, each with its own webhook URL and secret. Composes with the rest of the stack instead of reimplementing it: json for the body, webhook for the HMAC signature.

larzscript pkg install dispatch
View on GitHub →Learn the stack

What you get

Try it

import "dispatch" as dispatch
let hub = dispatch.hub()
dispatch.register(hub, "cryptolarz", "http://127.0.0.1:1/webhook", "secret-a")
dispatch.register(hub, "drlarz", "https://gateway.example.com/webhook", "secret-b")

print("registered:", dispatch.destination(hub, "cryptolarz"))
print("send to a closed port:", dispatch.send(hub, "cryptolarz", {"user": "a@example.com", "amount_usd": 5}))
print("send to an unregistered app:", dispatch.send(hub, "unknown", {"x": 1}))
Output
registered: {url: http://127.0.0.1:1/webhook, secret: secret-a}
send to a closed port: false
send to an unregistered app: false

Why it's in the Larz Stack

larzdispatch is a real Larzscript package (larzscript pkg install dispatch) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.