Supporting "bring your own key" #2957

Open
opened 2026-03-13 10:30:28 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @rosano on GitHub (Mar 2, 2026).

Is this suited for github?

  • Yes, this is suited for github

For my self-hostable project, someone hosting can integrate GitHub by passing their credentials to better-auth, but it would be nice if the end-users could use their own credentials in case the host decides not to integrate.

Describe the solution you'd like

This could happen without changing the config and by calling the provider methods directly.

Perhaps I can already just do this, but is using the account table to store access tokens for arbitrary providers likely to cause issues in the future?

socialProviders.github or the parent could also accept a function that gets called at runtime.

Describe alternatives you've considered

I can use a separate OAuth library like Arctic but it means defining each integrated social login in better-auth and another library + potentially storing in different tables.

Additional context

No response

Originally created by @rosano on GitHub (Mar 2, 2026). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. For my self-hostable project, someone hosting can integrate GitHub by passing their credentials to better-auth, but it would be nice if the end-users could use their own credentials in case the host decides not to integrate. ### Describe the solution you'd like This could happen without changing the config and by calling the [provider methods](https://github.com/better-auth/better-auth/blob/canary/packages/core/src/social-providers/github.ts) directly. Perhaps I can already just do this, but is using the `account` table to store access tokens for arbitrary providers likely to cause issues in the future? `socialProviders.github` or the parent could also accept a function that gets called at runtime. ### Describe alternatives you've considered I can use a separate OAuth library like [Arctic](https://arcticjs.dev) but it means defining each integrated social login in better-auth and another library + potentially storing in different tables. ### Additional context _No response_
GiteaMirror added the enhancement label 2026-03-13 10:30:29 -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#2957