[PR #5827] chore: re-export access & db types #14503

Closed
opened 2026-04-13 09:30:34 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5827

State: closed
Merged: Yes


import type { BetterAuthClientOptions } from "better-auth/client";
// or `import type { BetterAuthClientOptions } from "better-auth"`;
import { adminClient, organizationClient } from "better-auth/client/plugins";

export const clientOptions = {
	plugins: [adminClient(), organizationClient()],
} as const satisfies BetterAuthClientOptions;

throws the following TypeError:

The inferred type of 'clientOptions' cannot be named without a reference to '../../node_modules/better-auth/dist/index-wkPZOg89.mjs' (src/plugins/access/index.ts). This is likely not portable. A type annotation is necessary.ts(2742)

The inferred type of 'clientOptions' cannot be named without a reference to '.pnpm/@better-auth+core@1.4.0-bet_da03d1104a82a16ab24946c4a234a197/node_modules/@better-auth/core/db'. This is likely not portable. A type annotation is necessary.ts(2742)

Summary by cubic

Re-exported access and db types from both the client and root package entries to fix TS2742 errors when inferring BetterAuthClientOptions. Inferred types are now portable for imports from better-auth/client and better-auth.

  • Bug Fixes
    • Re-exported types from @better-auth/core/db and ../plugins/access in packages/better-auth/src/client/index.ts.
    • Re-exported types from @better-auth/core/db and ./plugins/access in packages/better-auth/src/index.ts.

Written for commit f9cf71d944. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5827 **State:** closed **Merged:** Yes --- ```ts import type { BetterAuthClientOptions } from "better-auth/client"; // or `import type { BetterAuthClientOptions } from "better-auth"`; import { adminClient, organizationClient } from "better-auth/client/plugins"; export const clientOptions = { plugins: [adminClient(), organizationClient()], } as const satisfies BetterAuthClientOptions; ``` throws the following TypeError: ```bash The inferred type of 'clientOptions' cannot be named without a reference to '../../node_modules/better-auth/dist/index-wkPZOg89.mjs' (src/plugins/access/index.ts). This is likely not portable. A type annotation is necessary.ts(2742) The inferred type of 'clientOptions' cannot be named without a reference to '.pnpm/@better-auth+core@1.4.0-bet_da03d1104a82a16ab24946c4a234a197/node_modules/@better-auth/core/db'. This is likely not portable. A type annotation is necessary.ts(2742) ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Re-exported access and db types from both the client and root package entries to fix TS2742 errors when inferring BetterAuthClientOptions. Inferred types are now portable for imports from better-auth/client and better-auth. - **Bug Fixes** - Re-exported types from @better-auth/core/db and ../plugins/access in packages/better-auth/src/client/index.ts. - Re-exported types from @better-auth/core/db and ./plugins/access in packages/better-auth/src/index.ts. <sup>Written for commit f9cf71d944e7519e6de4ef20064b001eba39e774. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:30:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14503