Event fan out and event bus #2877

Closed
opened 2026-03-13 10:25:08 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @joeblew999 on GitHub (Feb 16, 2026).

Is this suited for github?

  • Yes, this is suited for github

an outbound webhooks/events plugin seems like a natural ask given how many people need to fan auth events out to other systems.​​​​​​​​​​​​​​​​

Describe the solution you'd like

For example the QR based login .

You would want to tell some other system of the event .

Using the database with simple polling is a decent way to do it with retry . It’s not efficient but keeps all the logic in one system . For example I do this on Cloudflare D1 and the polling is cheap even on D1 .

Describe alternatives you've considered

None

Additional context

No response

Originally created by @joeblew999 on GitHub (Feb 16, 2026). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. an outbound webhooks/events plugin seems like a natural ask given how many people need to fan auth events out to other systems.​​​​​​​​​​​​​​​​ ### Describe the solution you'd like For example the QR based login . You would want to tell some other system of the event . Using the database with simple polling is a decent way to do it with retry . It’s not efficient but keeps all the logic in one system . For example I do this on Cloudflare D1 and the polling is cheap even on D1 . ### Describe alternatives you've considered None ### Additional context _No response_
GiteaMirror added the enhancement label 2026-03-13 10:25:08 -05:00
Author
Owner

@joeblew999 commented on GitHub (Feb 16, 2026):

Zod-validated payloads, registered endpoints, HMAC signing, retry logic. Seems like something the project would benefit from given how many people run Better Auth alongside other systems.​​​​​​​​​​​​​​​​

@joeblew999 commented on GitHub (Feb 16, 2026): Zod-validated payloads, registered endpoints, HMAC signing, retry logic. Seems like something the project would benefit from given how many people run Better Auth alongside other systems.​​​​​​​​​​​​​​​​
Author
Owner

@joeblew999 commented on GitHub (Feb 16, 2026):

Meanwhile the core has hooks.after and databaseHooks as low-level primitives, but no unified event system that all plugins emit into.
What’s missing is a single event bus at the core level:
∙ Every plugin (device auth, session, org, admin, stripe, etc.) emits standardized events into it
∙ One place to subscribe — whether you want to push webhooks, write to a queue, log to D1, whatever
∙ One Zod schema per event type, consistent across the whole system
∙ Consumers don’t need to know which plugin generated the event
Instead, today you’d have to wire up hooks.after with path matching, plus databaseHooks, plus each payment plugin’s custom callback — all separately. That’s the fragmentation.

@joeblew999 commented on GitHub (Feb 16, 2026): Meanwhile the core has hooks.after and databaseHooks as low-level primitives, but no unified event system that all plugins emit into. What’s missing is a single event bus at the core level: ∙ Every plugin (device auth, session, org, admin, stripe, etc.) emits standardized events into it ∙ One place to subscribe — whether you want to push webhooks, write to a queue, log to D1, whatever ∙ One Zod schema per event type, consistent across the whole system ∙ Consumers don’t need to know which plugin generated the event Instead, today you’d have to wire up hooks.after with path matching, plus databaseHooks, plus each payment plugin’s custom callback — all separately. That’s the fragmentation.
Author
Owner

@himself65 commented on GitHub (Feb 16, 2026):

We don't have the plan to add the event system

@himself65 commented on GitHub (Feb 16, 2026): We don't have the plan to add the event system
Author
Owner

@joeblew999 commented on GitHub (Feb 17, 2026):

Ok will do it myself on fork

@joeblew999 commented on GitHub (Feb 17, 2026): Ok will do it myself on fork
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2877