Expose social provider display names to clients (prefer client-side metadata) #2902

Closed
opened 2026-03-13 10:26:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @onmax on GitHub (Feb 20, 2026).

Originally assigned to: @himself65 on GitHub.

provider.name exists in Better Auth social provider definitions (example: GitHub provider), but client apps can’t access that directly.

So UI code usually does one of these:

  • manual label maps ({ github: "GitHub" })
  • string formatting hacks (capitalize(provider))

Both are easy to drift and hurt DX.

Describe the solution you'd like

Could we expose provider display names in a first-class way for clients?

I see two possible directions:

  1. Preferred: client-side metadata (client.name)

    • Add optional social provider metadata in client config (for example a name field).
    • Keeps this concern local to UI and avoids new API surface.
  2. Alternative: server endpoint

    • Add endpoint returning configured providers with { id, name }.
    • Gives runtime truth from server config, but feels heavier for this DX problem.

Describe alternatives you've considered

  • Keep manual maps in app code.
  • Keep formatting provider IDs at render time.

Both work but duplicate knowledge and are inconsistent.

Additional context

I’m happy to open a small PR in the direction maintainers prefer.

Originally created by @onmax on GitHub (Feb 20, 2026). Originally assigned to: @himself65 on GitHub. ### Is your feature request related to a problem? `provider.name` exists in Better Auth social provider definitions (example: [GitHub provider](https://github.com/better-auth/better-auth/blob/canary/packages/core/src/social-providers/github.ts#L65)), but client apps can’t access that directly. So UI code usually does one of these: - manual label maps (`{ github: "GitHub" }`) - string formatting hacks (`capitalize(provider)`) Both are easy to drift and hurt DX. ### Describe the solution you'd like Could we expose provider display names in a first-class way for clients? I see two possible directions: 1. Preferred: client-side metadata (`client.name`) - Add optional social provider metadata in client config (for example a `name` field). - Keeps this concern local to UI and avoids new API surface. 2. Alternative: server endpoint - Add endpoint returning configured providers with `{ id, name }`. - Gives runtime truth from server config, but feels heavier for this DX problem. ### Describe alternatives you've considered - Keep manual maps in app code. - Keep formatting provider IDs at render time. Both work but duplicate knowledge and are inconsistent. ### Additional context I’m happy to open a small PR in the direction maintainers prefer.
GiteaMirror added the enhancement label 2026-03-13 10:26:36 -05:00
Author
Owner

@himself65 commented on GitHub (Feb 20, 2026):

I don't think we should add this, since all providers use static IDs, and you can create it once and use it everywhere. But for us, we have to consider server-side and client-side, as well as bundle size. This would cause lots of work

@himself65 commented on GitHub (Feb 20, 2026): I don't think we should add this, since all providers use static IDs, and you can create it once and use it everywhere. But for us, we have to consider server-side and client-side, as well as bundle size. This would cause lots of work
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2902