[GH-ISSUE #680] Have an exported AuthClient type (analog to the Auth exported type for server-side) #8376

Closed
opened 2026-04-13 03:26:59 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @bfovez on GitHub (Nov 28, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/680

Is your feature request related to a problem? Please describe.
I would like to factorize an instance of authClient created by createAuthClient({ baseURL })

Describe the solution you'd like
Have an exported AuthClient type, analog to the Auth type for server-side.

Originally created by @bfovez on GitHub (Nov 28, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/680 **Is your feature request related to a problem? Please describe.** I would like to factorize an instance of `authClient `created by `createAuthClient({ baseURL })` **Describe the solution you'd like** Have an exported `AuthClient` type, analog to the `Auth` type for server-side.
GiteaMirror added the locked label 2026-04-13 03:26:59 -05:00
Author
Owner

@Bekacru commented on GitHub (Nov 28, 2024):

You can just use ReturnType<typeof createAuthClient<any>>, but I still wouldn't recommend inferring the auth client like that, as it relies on a lot of generic inference. (same for Auth)

<!-- gh-comment-id:2505720121 --> @Bekacru commented on GitHub (Nov 28, 2024): You can just use `ReturnType<typeof createAuthClient<any>>`, but I still wouldn't recommend inferring the auth client like that, as it relies on a lot of generic inference. (same for `Auth`)
Author
Owner

@bfovez commented on GitHub (Nov 28, 2024):

Thank for the tip.

<!-- gh-comment-id:2506711129 --> @bfovez commented on GitHub (Nov 28, 2024): Thank for the tip.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8376