[PR #5857] feat: add typed event emitter #14527

Closed
opened 2026-04-13 09:31:15 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5857

State: closed
Merged: No


Related: #5673

Introduces a built in event emitter.
Unlike hooks, it allows multiple independent listeners to subscribe to the same event from anywhere in userland.


Summary by cubic

Adds a built-in, typed event emitter to BetterAuth and emits default auth lifecycle events (signIn, signOut, signUp, verifyEmail, passwordReset). Apps and plugins can subscribe from anywhere with strong types.

  • New Features
    • Added EventEmitter/EventMixin with default events and plugin-extensible types.
    • Exposed auth.event and wired the emitter into AuthContext/init.
    • Emitting events in core routes: sign-in, sign-out, sign-up, email verification, and password reset.

Written for commit e3602b4be7. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5857 **State:** closed **Merged:** No --- Related: #5673 Introduces a built in event emitter. Unlike hooks, it allows multiple independent listeners to subscribe to the same event from anywhere in userland. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a built-in, typed event emitter to BetterAuth and emits default auth lifecycle events (signIn, signOut, signUp, verifyEmail, passwordReset). Apps and plugins can subscribe from anywhere with strong types. - **New Features** - Added EventEmitter/EventMixin with default events and plugin-extensible types. - Exposed auth.event and wired the emitter into AuthContext/init. - Emitting events in core routes: sign-in, sign-out, sign-up, email verification, and password reset. <sup>Written for commit e3602b4be79f78bddf458820a9d92e5a194b10da. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14527