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

Closed
opened 2026-04-15 21:31:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5827
Author: @jslno
Created: 11/7/2025
Status: Merged
Merged: 11/7/2025
Merged by: @himself65

Base: canaryHead: fix/client-options-type-reference


📝 Commits (2)

  • e490414 chore: re-export access & db types in client
  • f9cf71d chore: add exports in src/index.ts

📊 Changes

2 files changed (+6 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/client/index.ts (+4 -0)
📝 packages/better-auth/src/index.ts (+2 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5827 **Author:** [@jslno](https://github.com/jslno) **Created:** 11/7/2025 **Status:** ✅ Merged **Merged:** 11/7/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/client-options-type-reference` --- ### 📝 Commits (2) - [`e490414`](https://github.com/better-auth/better-auth/commit/e490414338e3f6f278f5ea8a335c23598b4d9b4f) chore: re-export access & db types in client - [`f9cf71d`](https://github.com/better-auth/better-auth/commit/f9cf71d944e7519e6de4ef20064b001eba39e774) chore: add exports in src/index.ts ### 📊 Changes **2 files changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/index.ts` (+4 -0) 📝 `packages/better-auth/src/index.ts` (+2 -1) </details> ### 📄 Description ```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. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 21:31:17 -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#23157