[GH-ISSUE #2382] createAdapter not exported #9172

Closed
opened 2026-04-13 04:32:18 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @seanjb on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2382

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

When following the guide here https://www.better-auth.com/docs/guides/create-a-db-adapter to create a Custom Adaptor it would appear the createAdapter method is not exported correctly.

Specifically the line import { createAdapter, type AdapterDebugLogs } from "better-auth/adapters";

Causes the TS error Module '"better-auth/adapters"' has no exported member 'createAdapter'.ts(2305)

Current vs. Expected behavior

createAdapter method should be exported and not cause a TS Error

What version of Better Auth are you using?

1.2.7

Provide environment information

- Mac

Which area(s) are affected? (Select all that apply)

Package

Auth config (if applicable)


Additional context

No response

Originally created by @seanjb on GitHub (Apr 21, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2382 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce When following the guide here https://www.better-auth.com/docs/guides/create-a-db-adapter to create a Custom Adaptor it would appear the createAdapter method is not exported correctly. Specifically the line `import { createAdapter, type AdapterDebugLogs } from "better-auth/adapters";` Causes the TS error `Module '"better-auth/adapters"' has no exported member 'createAdapter'.ts(2305)` ### Current vs. Expected behavior createAdapter method should be exported and not cause a TS Error ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - Mac ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 04:32:18 -05:00
Author
Owner

@taivo commented on GitHub (Sep 15, 2025):

This just resurfaced going from version 1.3.9 to 1.3.10

<!-- gh-comment-id:3294214171 --> @taivo commented on GitHub (Sep 15, 2025): This just resurfaced going from version 1.3.9 to 1.3.10
Author
Owner

@Bekacru commented on GitHub (Sep 15, 2025):

It's still exported

<!-- gh-comment-id:3294237173 --> @Bekacru commented on GitHub (Sep 15, 2025): It's still exported
Author
Owner

@taivo commented on GitHub (Sep 15, 2025):

strange .. I just updated from 1.3.9 and had this issue. Downgrading back to 1.3.9 made it go away

<!-- gh-comment-id:3294240990 --> @taivo commented on GitHub (Sep 15, 2025): strange .. I just updated from 1.3.9 and had this issue. Downgrading back to 1.3.9 made it go away
Author
Owner

@taivo commented on GitHub (Sep 15, 2025):

When using "Go to definition" of better-auth/adapters in vscode, this is what I see for 1.3.9 vs 1.3.10. Could it be some sort of config issue on my side that caused the wrong types to be generated?

1.3.9

import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.tThsKLej.js';
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.tThsKLej.js';
import 'kysely';
import 'better-call';
import 'zod/v4';
import '../shared/better-auth.DTtXpZYr.js';
import '../shared/better-auth.B5FL4Q2B.js';
import 'zod/v4/core';
import 'zod';
import 'better-sqlite3';
import 'bun:sqlite';
import 'node:sqlite';

declare const createAdapter: ({ adapter, config: cfg, }: {
    config: AdapterConfig;
    adapter: CreateCustomAdapter;
}) => (options: BetterAuthOptions) => Adapter;

export { AdapterConfig, CreateCustomAdapter, createAdapter };

1.3.10

import { B as BetterAuthOptions, a as Adapter, C as CreateAdapterOptions } from '../shared/better-auth.B3WgX3fF.js';
export { b as AdapterConfig, A as AdapterDebugLogs, f as AdapterTestDebugLogs, e as CleanedWhere, c as CreateCustomAdapter, d as CustomAdapter } from '../shared/better-auth.B3WgX3fF.js';
import 'zod';
import 'kysely';
import 'better-call';
import '../shared/better-auth.DTtXpZYr.js';
import '../shared/better-auth.B2AIpsP8.js';
import 'zod/v4/core';
import 'better-sqlite3';
import 'bun:sqlite';
import 'node:sqlite';

type AdapterFactory = (options: BetterAuthOptions) => Adapter;
declare const createAdapterFactory: ({ adapter: customAdapter, config: cfg, }: CreateAdapterOptions) => AdapterFactory;

export { CreateAdapterOptions, createAdapterFactory };
export type { AdapterFactory };

<!-- gh-comment-id:3294265328 --> @taivo commented on GitHub (Sep 15, 2025): When using "Go to definition" of `better-auth/adapters` in vscode, this is what I see for 1.3.9 vs 1.3.10. Could it be some sort of config issue on my side that caused the wrong types to be generated? 1.3.9 ``` import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.tThsKLej.js'; export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.tThsKLej.js'; import 'kysely'; import 'better-call'; import 'zod/v4'; import '../shared/better-auth.DTtXpZYr.js'; import '../shared/better-auth.B5FL4Q2B.js'; import 'zod/v4/core'; import 'zod'; import 'better-sqlite3'; import 'bun:sqlite'; import 'node:sqlite'; declare const createAdapter: ({ adapter, config: cfg, }: { config: AdapterConfig; adapter: CreateCustomAdapter; }) => (options: BetterAuthOptions) => Adapter; export { AdapterConfig, CreateCustomAdapter, createAdapter }; ``` 1.3.10 ``` import { B as BetterAuthOptions, a as Adapter, C as CreateAdapterOptions } from '../shared/better-auth.B3WgX3fF.js'; export { b as AdapterConfig, A as AdapterDebugLogs, f as AdapterTestDebugLogs, e as CleanedWhere, c as CreateCustomAdapter, d as CustomAdapter } from '../shared/better-auth.B3WgX3fF.js'; import 'zod'; import 'kysely'; import 'better-call'; import '../shared/better-auth.DTtXpZYr.js'; import '../shared/better-auth.B2AIpsP8.js'; import 'zod/v4/core'; import 'better-sqlite3'; import 'bun:sqlite'; import 'node:sqlite'; type AdapterFactory = (options: BetterAuthOptions) => Adapter; declare const createAdapterFactory: ({ adapter: customAdapter, config: cfg, }: CreateAdapterOptions) => AdapterFactory; export { CreateAdapterOptions, createAdapterFactory }; export type { AdapterFactory }; ```
Author
Owner

@Bekacru commented on GitHub (Sep 15, 2025):

just chekd with the team, seems like there was a PR which renamed createAdapter to createAdapterFactory. We'll push a patch as that shouldn't be the case but for now you should be able to use createAdapterFactory

<!-- gh-comment-id:3294274578 --> @Bekacru commented on GitHub (Sep 15, 2025): just chekd with the team, seems like there was a PR which renamed `createAdapter` to `createAdapterFactory`. We'll push a patch as that shouldn't be the case but for now you should be able to use `createAdapterFactory`
Author
Owner

@himself65 commented on GitHub (Sep 16, 2025):

Sorry for the inconvenience. I should add a deprecate tag here. let me fix it

<!-- gh-comment-id:3294413963 --> @himself65 commented on GitHub (Sep 16, 2025): Sorry for the inconvenience. I should add a deprecate tag here. let me fix it
Author
Owner

@taivo commented on GitHub (Sep 16, 2025):

Just updated to 1.3.11 .. All is good again. Thank you for the super fast turn around!

<!-- gh-comment-id:3294654822 --> @taivo commented on GitHub (Sep 16, 2025): Just updated to 1.3.11 .. All is good again. Thank you for the super fast turn around!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9172