@onmax/nuxt-better-auth 0.0.2-alpha.21 → 0.0.2-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  ## Documentation
22
22
 
23
- **[nuxt-better-auth.onmax.me](https://nuxt-better-auth.onmax.me/)**
23
+ **[better-auth.nuxt.dev](https://better-auth.nuxt.dev/)**
24
24
 
25
25
  ## License
26
26
 
package/dist/module.d.mts CHANGED
@@ -1,9 +1,39 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import { Nuxt } from '@nuxt/schema';
2
3
  import { BetterAuthModuleOptions } from '../dist/runtime/config.js';
3
4
  export { BetterAuthModuleOptions, defineClientAuth, defineServerAuth } from '../dist/runtime/config.js';
4
5
  import { BetterAuthOptions } from 'better-auth';
5
6
  export { Auth, AuthMeta, AuthMode, AuthRouteRules, AuthSession, AuthUser, InferSession, InferUser, RequireSessionOptions, ServerAuthContext, UserMatch } from '../dist/runtime/types.js';
6
7
 
8
+ interface DefineServerAuthFn {
9
+ (...args: unknown[]): unknown;
10
+ _count: number;
11
+ }
12
+ declare global {
13
+ var defineServerAuth: DefineServerAuthFn | undefined;
14
+ }
15
+
16
+ type DbDialect = 'sqlite' | 'postgresql' | 'mysql';
17
+
18
+ interface BetterAuthDatabaseProviderBuildContext {
19
+ hubDialect: DbDialect;
20
+ usePlural: boolean;
21
+ camelCase: boolean;
22
+ }
23
+ interface BetterAuthDatabaseProviderSetupContext {
24
+ nuxt: Nuxt;
25
+ options: BetterAuthModuleOptions;
26
+ clientOnly: boolean;
27
+ }
28
+ interface BetterAuthDatabaseProviderEnabledContext extends BetterAuthDatabaseProviderSetupContext {
29
+ hasHubDbAvailable: boolean;
30
+ }
31
+ interface BetterAuthDatabaseProviderDefinition {
32
+ buildDatabaseCode: (ctx: BetterAuthDatabaseProviderBuildContext) => string;
33
+ setup?: (ctx: BetterAuthDatabaseProviderSetupContext) => void | Promise<void>;
34
+ isEnabled?: (ctx: BetterAuthDatabaseProviderEnabledContext) => boolean;
35
+ priority?: number;
36
+ }
7
37
  declare module '@nuxt/schema' {
8
38
  interface NuxtHooks {
9
39
  /**
@@ -12,6 +42,11 @@ declare module '@nuxt/schema' {
12
42
  * @param config - Partial config to merge into the auth options
13
43
  */
14
44
  'better-auth:config:extend': (config: Partial<BetterAuthOptions>) => void | Promise<void>;
45
+ /**
46
+ * Register or override Better Auth database providers.
47
+ * Providers are auto-selected via `isEnabled` + `priority`.
48
+ */
49
+ 'better-auth:database:providers': (providers: Record<string, BetterAuthDatabaseProviderDefinition>) => void | Promise<void>;
15
50
  }
16
51
  }
17
52
 
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@onmax/nuxt-better-auth",
3
- "version": "0.0.2-alpha.21",
3
+ "version": "0.0.2-alpha.23",
4
4
  "configKey": "auth",
5
5
  "compatibility": {
6
- "nuxt": ">=3.0.0"
6
+ "nuxt": ">=4.0.0"
7
7
  },
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",