Skip to content

feat: add @trakoo/better-auth plugin, pii routing and EmitKit notify override - #45

Merged
multiplehats merged 8 commits into
mainfrom
multiplehats/trakoo-better-auth-plugin
Sep 29, 2026
Merged

multiplehats merged 8 commits into
mainfrom
multiplehats/trakoo-better-auth-plugin

Conversation

@multiplehats

@multiplehats multiplehats commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Adds @trakoo/better-auth, a Better Auth plugin (better-auth ^1.7.0) that sends a typed trakoo event for each auth lifecycle change: sign-ups, sign-ins, sessions, password and email changes, organizations, API keys, admin actions, two-factor, passkeys, anonymous users, SSO and Stripe subscriptions. It exports an authEvents registry to merge into your own, registers events only for the Better Auth plugins you install (team events only with teams enabled), reports database changes only after commit, identifies users, and never sends secrets or throws into Better Auth. Core trakoo gains a pii: false provider routing option that keeps email and name from a provider, and a type fix so a registry can be spread into defineEvents(). @trakoo/emitkit now reads a boolean __emitkit_notify property that overrides notify for a single event. Also included: tests (68 for the plugin), verify:package support for the new root-entry package, a new Integrations docs page, updates to the EmitKit, routing and events docs and the agent skill, and changesets for all three packages.

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
trakoo Ready Ready Preview Sep 29, 2026 12:00pm UTC

- sessionId: every event carries the request's session of the user it is
  about, resolved when the event happens; none when acting on someone else
- api keys: report the acting user, never the org referenceId; add
  organizationId for organization-owned keys
- team events are active only when organization teams are enabled
- rename impersonation registry keys to userImpersonationStarted/Stopped
- drop the redundant twoFactor sign-in property
- one path→handler map for after hooks; shared organization hook reader
- read the identify option once; pii routing and emitkit notify helpers
- field readers move to fields.ts; docs and changeset updated
plugin.ts keeps the options, the send pipeline and the wiring. Each Better
Auth plugin's events move to their own module (core.ts, plugins/*.ts),
built from a small toolkit (emit, stateOf, actorOf, wrap) and returning its
after-hook handlers by path and the callbacks it wraps at init.
@multiplehats
multiplehats merged commit cdcdf96 into main Sep 29, 2026
16 checks passed

This branch was successfully deployed

1 active deployment
Preview — f9080393 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant