How-to guides
Configure Google sign-in
Obtain an identity token in Android and iOS shells.
Create OAuth clients
Configure Google Cloud clients:
| Client | Match |
|---|---|
| Web | Backend audience |
| iOS | Bundle identifier |
| Android | Package identifier and build signing fingerprint |
Enable sign-in
Apply capability setup with internalPlugins.googleSignIn: true:
pnpm add @capawesome/capacitor-google-sign-in@0.1.4Configure identifiers
Set both environment variables to .apps.googleusercontent.com identifiers before generation:
pluginOptions: {
GoogleSignIn: {
webClientId: process.env.GOOGLE_WEB_CLIENT_ID,
iosClientId: process.env.GOOGLE_IOS_CLIENT_ID,
},
},Keep real identifiers out of example config.
Sign in
Connect a button to:
const google = useGoogleSignIn(); // @akshatowo/radical/react
google.signIn();Handle GoogleSignInCancelled separately.
Verify value.idToken on your backend before creating a session.