Skip to main content

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.

StepCode / endpoint
ConfigureGoogleSignin.configure({webClientId, iosClientId, scopes: ['email', 'profile']}) from Constants.expoConfig.extra.googleSignIn
Sign in / sign upalways shows the account picker, then POST rest/auth/google/ → {access, refresh, created}
Link / unlink from SettingsPOST / DELETE rest/auth/google/link/; GET rest/auth/identities/ (components/SignInMethodsSection.js)
Delete account with Googlecomponents/DeleteAccountModal.js
Buttoncomponents/GoogleSignInButton.js, hidden when no web client id

Handled error codes: account_disabled, account_linked_to_other_identity, play_services_unavailable, network.

Client ids​

PlatformWhere the id livesHow Google matches the app
Web client (the audience the backend checks)EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID → extra.googleSignIn.webClientIdtoken audience; must be in the backend's GOOGLE_SIGNIN_CLIENT_IDS
iOSEXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID; app.config.js adds the reversed id as a URL schemebundle id
Androidnone in the apppackage 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).