@delmaredigital/payload-better-auth 0.5.0 → 0.5.2

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.
@@ -1,8 +1,7 @@
1
- import { type PayloadAuthClient } from '../../exports/client.js';
2
1
  import type { AvailableScope } from '../../types/apiKey.js';
3
2
  export type ApiKeysManagementClientProps = {
4
- /** Optional pre-configured auth client */
5
- authClient?: PayloadAuthClient;
3
+ /** Optional pre-configured auth client with apiKey plugin */
4
+ authClient?: any;
6
5
  /** Page title. Default: 'API Keys' */
7
6
  title?: string;
8
7
  /** Available scopes for key creation. Auto-generated if not provided. */
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState, useEffect, useMemo, useRef } from 'react';
4
- import { createPayloadAuthClient } from '../../exports/client.js';
4
+ import { createAuthClient } from 'better-auth/react';
5
+ import { apiKeyClient } from '@better-auth/api-key/client';
5
6
  /**
6
7
  * Group scopes by collection for the UI.
7
8
  * Scopes like "posts:read", "posts:write" get grouped under "Posts"
@@ -89,7 +90,11 @@ import { createPayloadAuthClient } from '../../exports/client.js';
89
90
  }, [
90
91
  scopeGroups
91
92
  ]);
92
- const getClient = ()=>providedClient ?? createPayloadAuthClient();
93
+ const getClient = ()=>providedClient ?? createAuthClient({
94
+ plugins: [
95
+ apiKeyClient()
96
+ ]
97
+ });
93
98
  // Toggle a scope selection
94
99
  function toggleScope(scopeId) {
95
100
  setSelectedScopes((prev)=>prev.includes(scopeId) ? prev.filter((s)=>s !== scopeId) : [
@@ -4,7 +4,6 @@
4
4
  */
5
5
  export { createAuthClient } from 'better-auth/react';
6
6
  export { twoFactorClient } from 'better-auth/client/plugins';
7
- export { apiKeyClient } from '@better-auth/api-key/client';
8
7
  export { passkeyClient } from '@better-auth/passkey/client';
9
8
  /**
10
9
  * Default plugins included with Payload Better Auth.
@@ -674,47 +673,6 @@ export declare const payloadAuthPlugins: readonly [{
674
673
  TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
675
674
  INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
676
675
  };
677
- }, {
678
- id: "api-key";
679
- $InferServerPlugin: ReturnType<typeof import("@better-auth/api-key").apiKey>;
680
- pathMethods: {
681
- "/api-key/create": "POST";
682
- "/api-key/delete": "POST";
683
- "/api-key/delete-all-expired-api-keys": "POST";
684
- };
685
- $ERROR_CODES: {
686
- INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
687
- REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
688
- REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
689
- USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
690
- UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
691
- KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
692
- KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
693
- KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
694
- USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
695
- KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
696
- EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
697
- EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
698
- INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
699
- INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
700
- INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
701
- METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
702
- RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
703
- NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
704
- KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
705
- INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
706
- INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
707
- INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
708
- INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
709
- SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
710
- FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
711
- NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
712
- ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
713
- USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
714
- INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
715
- NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
716
- ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
717
- };
718
676
  }, {
719
677
  id: "passkey";
720
678
  $InferServerPlugin: ReturnType<(options?: import("@better-auth/passkey").PasskeyOptions | undefined) => {
@@ -741,7 +699,7 @@ export declare const payloadAuthPlugins: readonly [{
741
699
  email: string;
742
700
  emailVerified: boolean;
743
701
  name: string;
744
- image? /** Base URL for auth endpoints (defaults to window.location.origin) */: string | null | undefined;
702
+ image?: string | null | undefined;
745
703
  };
746
704
  };
747
705
  }>)[];
@@ -1373,7 +1331,7 @@ export interface PayloadAuthClientOptions {
1373
1331
  baseURL?: string;
1374
1332
  }
1375
1333
  /**
1376
- * Create a pre-configured auth client with default plugins (twoFactor, apiKey, passkey).
1334
+ * Create a pre-configured auth client with default plugins (twoFactor, passkey).
1377
1335
  *
1378
1336
  * This is a convenience wrapper for simple setups. For custom plugins with full type
1379
1337
  * safety, use `createAuthClient` with `payloadAuthPlugins` instead.
@@ -2222,241 +2180,6 @@ export declare function createPayloadAuthClient(options?: PayloadAuthClientOptio
2222
2180
  message?: string | undefined;
2223
2181
  }, FetchOptions["throw"] extends true ? true : false>>;
2224
2182
  };
2225
- } & {
2226
- apiKey: {
2227
- create: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
2228
- configId?: string | undefined;
2229
- name?: string | undefined;
2230
- expiresIn?: number | null | undefined;
2231
- prefix?: string | undefined;
2232
- remaining?: number | null | undefined;
2233
- metadata?: any;
2234
- refillAmount?: number | undefined;
2235
- refillInterval?: number | undefined;
2236
- rateLimitTimeWindow?: number | undefined;
2237
- rateLimitMax?: number | undefined;
2238
- rateLimitEnabled?: boolean | undefined;
2239
- permissions?: Record<string, string[]> | undefined;
2240
- userId?: unknown;
2241
- organizationId?: unknown;
2242
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
2243
- configId?: string | undefined;
2244
- name?: string | undefined;
2245
- expiresIn?: number | null | undefined;
2246
- prefix?: string | undefined;
2247
- remaining?: number | null | undefined;
2248
- metadata?: any;
2249
- refillAmount?: number | undefined;
2250
- refillInterval?: number | undefined;
2251
- rateLimitTimeWindow?: number | undefined;
2252
- rateLimitMax?: number | undefined;
2253
- rateLimitEnabled?: boolean | undefined;
2254
- permissions?: Record<string, string[]> | undefined;
2255
- userId?: unknown;
2256
- organizationId?: unknown;
2257
- } & {
2258
- fetchOptions?: FetchOptions | undefined;
2259
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
2260
- key: string;
2261
- metadata: any;
2262
- permissions: any;
2263
- id: string;
2264
- configId: string;
2265
- name: string | null;
2266
- start: string | null;
2267
- prefix: string | null;
2268
- referenceId: string;
2269
- refillInterval: number | null;
2270
- refillAmount: number | null;
2271
- lastRefillAt: Date | null;
2272
- enabled: boolean;
2273
- rateLimitEnabled: boolean;
2274
- rateLimitTimeWindow: number | null;
2275
- rateLimitMax: number | null;
2276
- requestCount: number;
2277
- remaining: number | null;
2278
- lastRequest: Date | null;
2279
- expiresAt: Date | null;
2280
- createdAt: Date;
2281
- updatedAt: Date;
2282
- }, {
2283
- code?: string | undefined;
2284
- message?: string | undefined;
2285
- }, FetchOptions["throw"] extends true ? true : false>>;
2286
- };
2287
- } & {
2288
- apiKey: {
2289
- get: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
2290
- id: string;
2291
- configId?: string | undefined;
2292
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
2293
- query: {
2294
- id: string;
2295
- configId?: string | undefined;
2296
- };
2297
- fetchOptions?: FetchOptions | undefined;
2298
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
2299
- metadata: Record<string, any> | null;
2300
- permissions: {
2301
- [key: string]: string[];
2302
- } | null;
2303
- id: string;
2304
- configId: string;
2305
- name: string | null;
2306
- start: string | null;
2307
- prefix: string | null;
2308
- referenceId: string;
2309
- refillInterval: number | null;
2310
- refillAmount: number | null;
2311
- lastRefillAt: Date | null;
2312
- enabled: boolean;
2313
- rateLimitEnabled: boolean;
2314
- rateLimitTimeWindow: number | null;
2315
- rateLimitMax: number | null;
2316
- requestCount: number;
2317
- remaining: number | null;
2318
- lastRequest: Date | null;
2319
- expiresAt: Date | null;
2320
- createdAt: Date;
2321
- updatedAt: Date;
2322
- }, {
2323
- code?: string | undefined;
2324
- message?: string | undefined;
2325
- }, FetchOptions["throw"] extends true ? true : false>>;
2326
- };
2327
- } & {
2328
- apiKey: {
2329
- update: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
2330
- keyId: string;
2331
- configId?: string | undefined;
2332
- userId?: unknown;
2333
- name?: string | undefined;
2334
- enabled?: boolean | undefined;
2335
- remaining?: number | undefined;
2336
- refillAmount?: number | undefined;
2337
- refillInterval?: number | undefined;
2338
- metadata?: any;
2339
- expiresIn?: number | null | undefined;
2340
- rateLimitEnabled?: boolean | undefined;
2341
- rateLimitTimeWindow?: number | undefined;
2342
- rateLimitMax?: number | undefined;
2343
- permissions?: Record<string, string[]> | null | undefined;
2344
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
2345
- keyId: string;
2346
- configId?: string | undefined;
2347
- userId?: unknown;
2348
- name?: string | undefined;
2349
- enabled?: boolean | undefined;
2350
- remaining?: number | undefined;
2351
- refillAmount?: number | undefined;
2352
- refillInterval?: number | undefined;
2353
- metadata?: any;
2354
- expiresIn?: number | null | undefined;
2355
- rateLimitEnabled?: boolean | undefined;
2356
- rateLimitTimeWindow?: number | undefined;
2357
- rateLimitMax?: number | undefined;
2358
- permissions?: Record<string, string[]> | null | undefined;
2359
- } & {
2360
- fetchOptions?: FetchOptions | undefined;
2361
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
2362
- metadata: Record<string, any> | null;
2363
- permissions: {
2364
- [key: string]: string[];
2365
- } | null;
2366
- id: string;
2367
- configId: string;
2368
- name: string | null;
2369
- start: string | null;
2370
- prefix: string | null;
2371
- referenceId: string;
2372
- refillInterval: number | null;
2373
- refillAmount: number | null;
2374
- lastRefillAt: Date | null;
2375
- enabled: boolean;
2376
- rateLimitEnabled: boolean;
2377
- rateLimitTimeWindow: number | null;
2378
- rateLimitMax: number | null;
2379
- requestCount: number;
2380
- remaining: number | null;
2381
- lastRequest: Date | null;
2382
- expiresAt: Date | null;
2383
- createdAt: Date;
2384
- updatedAt: Date;
2385
- }, {
2386
- code?: string | undefined;
2387
- message?: string | undefined;
2388
- }, FetchOptions["throw"] extends true ? true : false>>;
2389
- };
2390
- } & {
2391
- apiKey: {
2392
- delete: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
2393
- keyId: string;
2394
- configId?: string | undefined;
2395
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
2396
- keyId: string;
2397
- configId?: string | undefined;
2398
- } & {
2399
- fetchOptions?: FetchOptions | undefined;
2400
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
2401
- success: boolean;
2402
- }, {
2403
- code?: string | undefined;
2404
- message?: string | undefined;
2405
- }, FetchOptions["throw"] extends true ? true : false>>;
2406
- };
2407
- } & {
2408
- apiKey: {
2409
- list: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
2410
- configId?: string | undefined;
2411
- organizationId?: string | undefined;
2412
- limit?: unknown;
2413
- offset?: unknown;
2414
- sortBy?: string | undefined;
2415
- sortDirection?: "asc" | "desc" | undefined;
2416
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
2417
- query?: {
2418
- configId?: string | undefined;
2419
- organizationId?: string | undefined;
2420
- limit?: unknown;
2421
- offset?: unknown;
2422
- sortBy?: string | undefined;
2423
- sortDirection?: "asc" | "desc" | undefined;
2424
- } | undefined;
2425
- fetchOptions?: FetchOptions | undefined;
2426
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
2427
- apiKeys: {
2428
- metadata: Record<string, any> | null;
2429
- permissions: {
2430
- [key: string]: string[];
2431
- } | null;
2432
- id: string;
2433
- configId: string;
2434
- name: string | null;
2435
- start: string | null;
2436
- prefix: string | null;
2437
- referenceId: string;
2438
- refillInterval: number | null;
2439
- refillAmount: number | null;
2440
- lastRefillAt: Date | null;
2441
- enabled: boolean;
2442
- rateLimitEnabled: boolean;
2443
- rateLimitTimeWindow: number | null;
2444
- rateLimitMax: number | null;
2445
- requestCount: number;
2446
- remaining: number | null;
2447
- lastRequest: Date | null;
2448
- expiresAt: Date | null;
2449
- createdAt: Date;
2450
- updatedAt: Date;
2451
- }[];
2452
- total: number;
2453
- limit: number | undefined;
2454
- offset: number | undefined;
2455
- }, {
2456
- code?: string | undefined;
2457
- message?: string | undefined;
2458
- }, FetchOptions["throw"] extends true ? true : false>>;
2459
- };
2460
2183
  } & {
2461
2184
  passkey: {
2462
2185
  generateRegisterOptions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
@@ -2759,38 +2482,6 @@ export declare function createPayloadAuthClient(options?: PayloadAuthClientOptio
2759
2482
  INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
2760
2483
  TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
2761
2484
  INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
2762
- } & {
2763
- INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
2764
- REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
2765
- REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
2766
- USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
2767
- UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
2768
- KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
2769
- KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
2770
- KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
2771
- USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
2772
- KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
2773
- EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
2774
- EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
2775
- INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
2776
- INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
2777
- INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
2778
- METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
2779
- RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
2780
- NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
2781
- KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
2782
- INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
2783
- INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
2784
- INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
2785
- INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
2786
- SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
2787
- FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
2788
- NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
2789
- ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
2790
- USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
2791
- INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
2792
- NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
2793
- ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
2794
2485
  } & {
2795
2486
  CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
2796
2487
  YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
@@ -3,12 +3,10 @@
3
3
  * Re-exports createAuthClient from better-auth/react and common plugins
4
4
  */ import { createAuthClient } from 'better-auth/react';
5
5
  import { twoFactorClient } from 'better-auth/client/plugins';
6
- import { apiKeyClient } from '@better-auth/api-key/client';
7
6
  import { passkeyClient } from '@better-auth/passkey/client';
8
7
  // Re-export createAuthClient and common plugins
9
8
  export { createAuthClient } from 'better-auth/react';
10
9
  export { twoFactorClient } from 'better-auth/client/plugins';
11
- export { apiKeyClient } from '@better-auth/api-key/client';
12
10
  export { passkeyClient } from '@better-auth/passkey/client';
13
11
  /**
14
12
  * Default plugins included with Payload Better Auth.
@@ -27,11 +25,10 @@ export { passkeyClient } from '@better-auth/passkey/client';
27
25
  * ```
28
26
  */ export const payloadAuthPlugins = [
29
27
  twoFactorClient(),
30
- apiKeyClient(),
31
28
  passkeyClient()
32
29
  ];
33
30
  /**
34
- * Create a pre-configured auth client with default plugins (twoFactor, apiKey, passkey).
31
+ * Create a pre-configured auth client with default plugins (twoFactor, passkey).
35
32
  *
36
33
  * This is a convenience wrapper for simple setups. For custom plugins with full type
37
34
  * safety, use `createAuthClient` with `payloadAuthPlugins` instead.
@@ -8,7 +8,7 @@ import type { betterAuth, BetterAuthOptions } from 'better-auth';
8
8
  import type { ApiKeyScopesConfig } from '../types/apiKey.js';
9
9
  export type Auth = ReturnType<typeof betterAuth>;
10
10
  export type { PayloadWithAuth } from '../types/betterAuth.js';
11
- export type CreateAuthFunction = (payload: BasePayload) => Auth;
11
+ export type CreateAuthFunction = (payload: BasePayload) => any;
12
12
  export type BetterAuthPluginAdminOptions = {
13
13
  /** Disable auto-injection of logout button */
14
14
  disableLogoutButton?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delmaredigital/payload-better-auth",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Better Auth adapter and plugins for Payload CMS",
5
5
  "type": "module",
6
6
  "license": "MIT",