Google OAuth setup for Authverse projects
This page describes how to add and configure Google OAuth for Authverse projects.
Run the installer to add the Google provider to your project:
npx authverse@latest add googleIn Google Cloud Console (APIs & Services → Credentials), set the Authorized Redirect URIs for your OAuth 2.0 Client ID:
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:
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=Replace the values with the client ID and client secret from Google Cloud Console.
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 GoogleProviders from "@/components/authverse/GoogleProviders";
<GoogleProviders />;This renders the Google sign-in option where you include the component.
https://example.com with your real production domain.