Reference
Google sign-in API
Native identity tokens and browser service injection.
Native enablement is internalPlugins.googleSignIn. The dependency is @capawesome/capacitor-google-sign-in@0.1.4.
| Configuration | Contract |
|---|---|
pluginOptions.GoogleSignIn | Validated by GoogleSignInConfigSchema |
webClientId, iosClientId | Letters, digits, underscores, or hyphens, then .apps.googleusercontent.com |
| Generation | Runtime config; iOS client identifier and reversed URL scheme |
googleSignIn is an Effect of GoogleIdentity, requiring Bridge | BrowserGoogleSignIn | GoogleSignInConfiguration. GoogleIdentitySchema validates { idToken: nonempty string }.
| Service | Contract |
|---|---|
googleSignInLive(effect) | Provides BrowserGoogleSignInLive and GoogleSignInConfigurationLive |
| Native initialization | Uses webClientId before sign-in |
| Browser replacement | Injectable BrowserGoogleSignIn for an app-owned OAuth flow |
Typed errors
GoogleSignInError is BridgeError | GoogleSignInCancelled | GoogleSignInMisconfigured | GoogleSignInUnavailable.
| Error | Meaning |
|---|---|
GoogleSignInCancelled | Native sign-in rejects with SIGN_IN_CANCELED. |
GoogleSignInMisconfigured | Missing runtime config, initialization failure, or PROVIDER_CONFIGURATION_ERROR. Carries cause. |
GoogleSignInUnavailable | The default browser service cannot sign in. |
BridgeCallFailed | Other native rejection. |
BridgeDecodeError | Invalid native identity result. |
useGoogleSignIn() exposes signIn(), cancel(), loading state, value.idToken, and error. Interrupting the Effect does not provide a native sign-out API. Radical does not verify tokens or create an application session.
Platform support
| Capability | Android | iOS | Browser |
|---|---|---|---|
| Sign-in | Native identity token | Native identity token | Default service fails with GoogleSignInUnavailable |
| Token verification and session | App-owned backend | App-owned backend | App-owned backend |
Source: Google sign-in implementation.