[GH-ISSUE #1074] auth-client expose "options" variable #8582

Closed
opened 2026-04-13 03:42:04 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @daveycodez on GitHub (Dec 30, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1074

Is this suited for github?

  • Yes, this is suited for github

Describe the solution you'd like

I've dug around authClient (type AuthClient = ReturnType<typeof createAuthClient>)

Can't seem to find a way to look at the options that are set there. it would be great to be able to use something like authClient.options.emailAndPassword.enabled to check if email and password is enabled for the current auth client. This would be really helpful for 3rd party adapters and plugins. I'm currently writing prebuilt shadcn/ui & NextUI components for all auth cards & settings cards and right now I have to manually pass emailPassword={true}, providers={["google", "facebook"]} etc to my AuthCard, along with authClient={authClient}

If I could read the options from authClient, that would make these redundant configuration steps unnecessary.

It would also be cool if there was a useAuthClient hook that would get the current singleton authClient, then we wouldn't even need to manually pass authClient along to 3rd party libraries

Originally created by @daveycodez on GitHub (Dec 30, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1074 ### Is this suited for github? - [X] Yes, this is suited for github ### Describe the solution you'd like I've dug around authClient (`type AuthClient = ReturnType<typeof createAuthClient>`) Can't seem to find a way to look at the options that are set there. it would be great to be able to use something like authClient.options.emailAndPassword.enabled to check if email and password is enabled for the current auth client. This would be really helpful for 3rd party adapters and plugins. I'm currently writing prebuilt shadcn/ui & NextUI components for all auth cards & settings cards and right now I have to manually pass emailPassword={true}, providers={["google", "facebook"]} etc to my AuthCard, along with authClient={authClient} If I could read the options from authClient, that would make these redundant configuration steps unnecessary. It would also be cool if there was a useAuthClient hook that would get the current singleton authClient, then we wouldn't even need to manually pass authClient along to 3rd party libraries
GiteaMirror added the locked label 2026-04-13 03:42:05 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 31, 2024):

From the authClient we can't tell if email and password is enabled or what social providers are defined since it's only available on the server.

<!-- gh-comment-id:2566282541 --> @Bekacru commented on GitHub (Dec 31, 2024): From the authClient we can't tell if email and password is enabled or what social providers are defined since it's only available on the server.
Author
Owner

@Bekacru commented on GitHub (Dec 31, 2024):

But as an alternative, you could create a plugin that defines the accepts the config instead of passing it as a prop, if you prefer. Then, you could create an action that returns the config.

<!-- gh-comment-id:2566283817 --> @Bekacru commented on GitHub (Dec 31, 2024): But as an alternative, you could create a plugin that defines the accepts the config instead of passing it as a prop, if you prefer. Then, you could create an action that returns the config.
Author
Owner

@daveycodez commented on GitHub (Dec 31, 2024):

Yea I'm just realizing these options are all setup on the server side, I'll sort out a solution

<!-- gh-comment-id:2566312767 --> @daveycodez commented on GitHub (Dec 31, 2024): Yea I'm just realizing these options are all setup on the server side, I'll sort out a solution
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8582