Summary
Better Hub currently only works with github.com. It would be great to support GitHub Enterprise Server (GHES) instances, since a lot of teams and orgs run private GHES deployments internally.
Problem
- All GitHub API calls, OAuth flows, and web URLs are hardcoded to
github.com / api.github.com
- The
socialProviders.github OAuth provider uses github.com endpoints exclusively
- Avatar URLs on GHES private-mode instances require web session cookies (API tokens don't work for the avatars subdomain)
- Links throughout the UI point to
github.com with no way to override
Proposal
-
Centralized GitHub URL config — a single github-config.ts that reads from environment variables (GITHUB_WEB_URL, GITHUB_API_URL, GITHUB_GRAPHQL_URL, etc.) and falls back to github.com defaults. Every file that builds a GitHub URL imports from this config instead of hardcoding.
-
Generic OAuth — replace socialProviders.github with better-auth's genericOAuth plugin so the authorization and token endpoints can point at a GHES instance.
-
Avatar proxy for GHES private mode — a server-side route that authenticates with the GHES web UI, caches the session cookie, and proxies avatar images. A GhesImage component wraps next/image to transparently route GHES avatar URLs through the proxy.
-
UI link updates — swap all hardcoded https://github.com references in components to use the configurable base URL, so "Open in GitHub" links, breadcrumbs, and copy-link buttons all point at the correct host.
Configuration
The following env vars would control GHES mode (all optional, defaults to github.com):
NEXT_PUBLIC_GITHUB_WEB_URL=https://ghes.example.com
GITHUB_API_URL=https://ghes.example.com/api/v3
GITHUB_GRAPHQL_URL=https://ghes.example.com/api/graphql
# For private-mode avatar proxying
GHES_AVATAR_USERNAME=bot-account
GHES_AVATAR_PASSWORD=password
When none of these are set, behavior is identical to today.
Notes
- GHES uses
/api/v3 and /api/graphql paths on the same host rather than separate api.github.com / github.com domains
- Private mode GHES instances serve avatars behind web session auth, not API token auth
- OAuth apps on GHES support the same OAuth2 flow, just with different endpoint URLs
Summary
Better Hub currently only works with github.com. It would be great to support GitHub Enterprise Server (GHES) instances, since a lot of teams and orgs run private GHES deployments internally.
Problem
github.com/api.github.qkg1.topsocialProviders.githubOAuth provider uses github.com endpoints exclusivelygithub.qkg1.topwith no way to overrideProposal
Centralized GitHub URL config — a single
github-config.tsthat reads from environment variables (GITHUB_WEB_URL,GITHUB_API_URL,GITHUB_GRAPHQL_URL, etc.) and falls back to github.com defaults. Every file that builds a GitHub URL imports from this config instead of hardcoding.Generic OAuth — replace
socialProviders.githubwith better-auth'sgenericOAuthplugin so the authorization and token endpoints can point at a GHES instance.Avatar proxy for GHES private mode — a server-side route that authenticates with the GHES web UI, caches the session cookie, and proxies avatar images. A
GhesImagecomponent wrapsnext/imageto transparently route GHES avatar URLs through the proxy.UI link updates — swap all hardcoded
https://github.qkg1.topreferences in components to use the configurable base URL, so "Open in GitHub" links, breadcrumbs, and copy-link buttons all point at the correct host.Configuration
The following env vars would control GHES mode (all optional, defaults to github.com):
When none of these are set, behavior is identical to today.
Notes
/api/v3and/api/graphqlpaths on the same host rather than separateapi.github.com/github.qkg1.topdomains