---
name: add-google-sign-in
description: "One OAuth client per project, redirect URIs for live and local, secrets only in env."
---

# Add Google sign-in

Purpose:: Visitors sign in with Google on the project, live and local.

Rules::
- One OAuth client per project; rerunning never creates a duplicate
- Secrets live in your env file and host settings; never in git or replies
- One "Continue with Google" button for both sign in and sign up

Inventory::
- Google Cloud project with a published consent screen
- Your auth library (for example NextAuth) and host env settings

Steps::
1. Create a Web OAuth client named after the project
2. Add origins and redirect URIs: localhost, the host URL and the domain (+ www)
3. Save the client id and secret to your env file and the host; redeploy
4. Check /api/auth/providers lists google and the button opens Google, not redirect_uri_mismatch
5. Reply in one line: client name, login works

Metrics::
- Login and signup reach the app
- No secret in the repo

Source:: https://isklls.com/skills/add-google-sign-in (iSklls, free skill library)
