Google sign-in
@react-native-google-signin/google-signin obtains a Google ID token on the device; utils/googleSignIn.js posts it to the backend.
| Step | Code / endpoint |
|---|---|
| Configure | GoogleSignin.configure({webClientId, iosClientId, scopes: ['email', 'profile']}) from Constants.expoConfig.extra.googleSignIn |
| Sign in / sign up | always shows the account picker, then POST rest/auth/google/ → {access, refresh, created} |
| Link / unlink from Settings | POST / DELETE rest/auth/google/link/; GET rest/auth/identities/ (components/SignInMethodsSection.js) |
| Delete account with Google | components/DeleteAccountModal.js |
| Button | components/GoogleSignInButton.js, hidden when no web client id |
Handled error codes: account_disabled, account_linked_to_other_identity, play_services_unavailable, network.
Client ids
| Platform | Where the id lives | How Google matches the app |
|---|---|---|
| Web client (the audience the backend checks) | EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID → extra.googleSignIn.webClientId | token audience; must be in the backend's GOOGLE_SIGNIN_CLIENT_IDS |
| iOS | EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID; app.config.js adds the reversed id as a URL scheme | bundle id |
| Android | none in the app | package name + signing certificate SHA-1: one Android client per keystore (debug, each EAS credential) |
What needs a rebuild
Changing a client id, adding the plugin or upgrading the library changes native code: ship a new development build for testing and a new EAS production build for users. An OTA update is not enough.
Setup and checklist
The end-to-end runbook (GCP project, consent screen, the three clients, backend config, app builds, test checklist on dev, App Store pre-submission notes) is docs/GOOGLE_SIGN_IN_SETUP.md. The backend side is summarised in Google (sign-in and Meet).