[GH-ISSUE #5971] Export BetterAuthOptions in better-auth/minimal #19022

Closed
opened 2026-04-15 17:47:40 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @CHC383 on GitHub (Nov 13, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5971

Is this suited for github?

  • Yes, this is suited for github

It would be helpful if better-auth/minimal exports BetterAuthOptions, so that user could write code like

import { betterAuth, type BetterAuthOptions } from "better-auth/minimal";

const config: BetterAuthOptions = { ... };
// or
const config = { ... } satisfies BetterAuthOptions;

export const auth = betterAuth(config);

Describe the solution you'd like

Export type BetterAuthOptions, something like

// packages/better-auth/src/auth/minimal.ts

export type { BetterAuthOptions } from "@better-auth/core";

Describe alternatives you've considered

  1. Import from better-auth
    import type { BetterAuthOptions } from "better-auth";
    
  2. Import from @better-auth/core
    import type { BetterAuthOptions } from "@better-auth/core";
    
  3. Avoid typing the config object, but this would make it less flexible to modify the config object.
    export const auth = betterAuth({ ... });
    

Additional context

No response

Originally created by @CHC383 on GitHub (Nov 13, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5971 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It would be helpful if `better-auth/minimal` exports `BetterAuthOptions`, so that user could write code like ```ts import { betterAuth, type BetterAuthOptions } from "better-auth/minimal"; const config: BetterAuthOptions = { ... }; // or const config = { ... } satisfies BetterAuthOptions; export const auth = betterAuth(config); ``` ### Describe the solution you'd like Export type `BetterAuthOptions`, something like ```ts // packages/better-auth/src/auth/minimal.ts export type { BetterAuthOptions } from "@better-auth/core"; ``` ### Describe alternatives you've considered 1. Import from `better-auth` ```ts import type { BetterAuthOptions } from "better-auth"; ``` 2. Import from `@better-auth/core` ```ts import type { BetterAuthOptions } from "@better-auth/core"; ``` 3. Avoid typing the config object, but this would make it less flexible to modify the config object. ```ts export const auth = betterAuth({ ... }); ``` ### Additional context _No response_
GiteaMirror added the lockedenhancement labels 2026-04-15 17:47:40 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 13, 2025):

Thanks for submitting this feature request regarding exporting BetterAuthOptions from the minimal package. Your suggestion to allow users to import the type directly and leverage TypeScript’s type inference for their configuration is very clear and could definitely improve developer ergonomics. A potential short-term workaround is to continue importing the type from the core package as you suggested, but having it exported from minimal would streamline the process.

Our team is taking a closer look at this request and discussing its feasibility for future releases. Could you share more on how this change might impact your integration experience or any additional features you’d like to see in the context of better type support?

tag @better-auth-agent if you would like an answer from the Agent

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3529845788 --> @better-auth-agent[bot] commented on GitHub (Nov 13, 2025): Thanks for submitting this feature request regarding exporting BetterAuthOptions from the minimal package. Your suggestion to allow users to import the type directly and leverage TypeScript’s type inference for their configuration is very clear and could definitely improve developer ergonomics. A potential short-term workaround is to continue importing the type from the core package as you suggested, but having it exported from minimal would streamline the process. Our team is taking a closer look at this request and discussing its feasibility for future releases. Could you share more on how this change might impact your integration experience or any additional features you’d like to see in the context of better type support? tag @better-auth-agent if you would like an answer from the Agent <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@rovertrack commented on GitHub (Nov 14, 2025):

solution you have only provided is right , would you be raising the PR

<!-- gh-comment-id:3531213926 --> @rovertrack commented on GitHub (Nov 14, 2025): solution you have only provided is right , would you be raising the PR
Author
Owner

@GautamBytes commented on GitHub (Nov 14, 2025):

I will be raising a pr soon for this!

<!-- gh-comment-id:3531550918 --> @GautamBytes commented on GitHub (Nov 14, 2025): I will be raising a pr soon for this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19022