GitHub OAuth setup for Authverse projects
This page describes how to add and configure GitHub OAuth for Authverse projects.
Run the installer to add the GitHub provider to your project:
npx authverse@latest add githubIn GitHub (Settings → Developer settings → OAuth Apps → Your App), set the Authorization callback URL for your OAuth App:
If you change your auth base path (the default is /api/auth), update these redirect URIs to match the new base path.
Add the following variables to your project's .env file:
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=Replace the values with the client ID and client secret from your GitHub OAuth App.
Adjust the snippet to use your preferred method of securely storing secrets for CI/deploy pipelines.
Import the prebuilt provider component and add it to your UI:
import GithubProviders from "@/components/authverse/GithubProviders";
<GithubProviders />;This renders the GitHub sign-in option where you include the component.
https://example.com with your real production domain.