@byo-oss/core is the shared library for apps that run two or more BYO packages. It gives them one event bus, one cron route and one org-cleanup call, so you wire each of those once instead of once per package.
Community plugin — not affiliated with the better-auth team.
It is a library, not a plugin: it adds no tables and no endpoints, and there is nothing to add to betterAuth({ plugins }). It reads the plugins you already pass there and calls the hooks that BYO plugins declare under a byo key. With a single BYO package you don’t need it.
What you get
- One event bus.
createEventBusturns a list of consumers into the oneonEventhandler you pass to every BYO plugin that emits events. A consumer that throws is reported and the next one still runs. See Server API. - One cron route.
sweepAllruns every plugin’s background work from a single route, in plugin order, inside a time budget you set. See Server API. - One cleanup call.
deleteOrganizationDataanddeleteMemberDatafan out to every plugin that stores per-organization or per-member data. All plugins run, and if any failed you get aByoFanOutError. See Server API. - A contract for plugin authors. A plugin declares
sweep,deleteOrganizationDataanddeleteMemberDataunderbyo, and core reaches them. See Hooks for plugin authors.
Not included (yet)
- Not a job queue or scheduler: you still need one cron that calls
sweepAll. - Not durable events: no outbox, no retries, no cross-process delivery.
- No user-delete fan-out: user data goes through foreign keys and each plugin’s own
databaseHooks. - No data export fan-out, and no shared identity (
identify(request)) helper yet.
Where to go next
- Quickstart wires the bus, the cron route and the cleanup hooks.
- Server API lists every export and what each helper guarantees.