Files
better-auth/packages/core
Gustavo Valverde 78bb334f0a feat(core): add plugin extension registry and dependency validation
Introduce the foundational Plugin Extension Protocol — a typed,
declarative mechanism for plugins to extend other plugins.

- BetterAuthExtensionRegistry: empty interface augmented by host
  plugins via declare module (parallel to BetterAuthPluginRegistry)
- extensions field on BetterAuthPlugin: typed via registry, gives
  compile-time checking and IDE autocomplete for extension contracts
- dependencies field on BetterAuthPlugin: validated at startup,
  throws BetterAuthError with descriptive message if missing
- getExtensions(hostId) on AuthContext: collects typed extension
  contributions from all plugins targeting a host
- Dependency validation in runPluginInit: fail-fast before any
  init runs
- Docs: Plugin Extension Protocol section in concepts/plugins.mdx
2026-03-20 00:53:52 +00:00
..

Better Auth Core

Core utilities and types for Better Auth — the most comprehensive authentication framework for TypeScript.

Installation

npm install @better-auth/core

Documentation

For full documentation, visit better-auth.com.

License

MIT