mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-20 20:26:55 -05:00
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