---
description: Capacitor plugin to sign in with Google on Android, iOS, and Web. Supports ID tokens, OAuth scopes, and user profile retrieval.
title: Capacitor Google Sign-In Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/google-sign-in.png
---

[ Skip to content](#capawesomecapacitor-google-sign-in) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* Google Sign-In [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Security ](#security)
* [  FAQ ](#faq)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Security ](#security)
* [  FAQ ](#faq)
* [  Changelog ](#changelog)
* [  License ](#license)

# @capawesome/capacitor-google-sign-in[¶](#capawesomecapacitor-google-sign-in "Permanent link")

Unofficial Capacitor plugin to sign-in with Google.[1](#fn:1)

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer a comprehensive Capacitor plugin for Google Sign-In. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS, and Web.
* 🔐 **Authentication**: Sign in users with their Google account and receive an ID token (JWT).
* 🔑 **Authorization**: Optionally request OAuth scopes to get an access token and server auth code.
* 👤 **User Profile**: Retrieve the user's email, display name, profile picture, and more.
* 🛡️ **Nonce Support**: Prevent replay attacks with a custom nonce on Android and Web.
* 🪶 **Lightweight**: Just a single dependency and zero unnecessary bloat.
* 🚨 **Error Codes**: Provides detailed error codes for better error handling.
* 🤝 **Compatibility**: Compatible with the [OAuth](https://capawesome.io/plugins/oauth) plugins.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 0.1.x          | \>=8.x.x          | Active support |

## Guides[¶](#guides "Permanent link")

* [How to Sign In with Google using Capacitor](https://capawesome.io/blog/how-to-sign-in-with-google-using-capacitor/)

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-google-sign-in` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-google-sign-in
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

This plugin will use the following project variables (defined in your app's `variables.gradle` file):

* `$androidxCredentialsVersion` version of `androidx.credentials:credentials` (default: `1.5.0`)
* `$googleIdVersion` version of `com.google.android.libraries.identity.googleid:googleid` (default: `1.1.1`)
* `$playServicesAuthVersion` version of `com.google.android.gms:play-services-auth` (default: `21.5.0`)

### iOS[¶](#ios "Permanent link")

Add the `GIDClientID` key to the `ios/App/App/Info.plist` file with your iOS client ID from the Google Cloud Console:

`[](#%5F%5Fcodelineno-3-1)<key>GIDClientID</key>
[](#%5F%5Fcodelineno-3-2)<string>YOUR_IOS_CLIENT_ID</string>
`

You also need to add the URL scheme for your iOS client ID to the `ios/App/App/Info.plist` file:

`[](#%5F%5Fcodelineno-4-1)<key>CFBundleURLTypes</key>
[](#%5F%5Fcodelineno-4-2)<array>
[](#%5F%5Fcodelineno-4-3)  <dict>
[](#%5F%5Fcodelineno-4-4)    <key>CFBundleURLSchemes</key>
[](#%5F%5Fcodelineno-4-5)    <array>
[](#%5F%5Fcodelineno-4-6)      <string>com.googleusercontent.apps.YOUR_IOS_CLIENT_ID</string>
[](#%5F%5Fcodelineno-4-7)    </array>
[](#%5F%5Fcodelineno-4-8)  </dict>
[](#%5F%5Fcodelineno-4-9)</array>
`

Replace `YOUR_IOS_CLIENT_ID` with the reversed client ID from the Google Cloud Console (e.g. `com.googleusercontent.apps.123456789-abc`).

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-5-1)import { GoogleSignIn } from '@capawesome/capacitor-google-sign-in';
[](#%5F%5Fcodelineno-5-2)import { Capacitor } from '@capacitor/core';
[](#%5F%5Fcodelineno-5-3)
[](#%5F%5Fcodelineno-5-4)const initialize = async () => {
[](#%5F%5Fcodelineno-5-5)  await GoogleSignIn.initialize({
[](#%5F%5Fcodelineno-5-6)    clientId: '123456789-abc.apps.googleusercontent.com',
[](#%5F%5Fcodelineno-5-7)    scopes: ['https://www.googleapis.com/auth/userinfo.profile'],
[](#%5F%5Fcodelineno-5-8)  });
[](#%5F%5Fcodelineno-5-9)};
[](#%5F%5Fcodelineno-5-10)
[](#%5F%5Fcodelineno-5-11)const signIn = async () => {
[](#%5F%5Fcodelineno-5-12)  const result = await GoogleSignIn.signIn();
[](#%5F%5Fcodelineno-5-13)  console.log(result.idToken);
[](#%5F%5Fcodelineno-5-14)  console.log(result.userId);
[](#%5F%5Fcodelineno-5-15)  console.log(result.email);
[](#%5F%5Fcodelineno-5-16)  console.log(result.displayName);
[](#%5F%5Fcodelineno-5-17)  console.log(result.accessToken);
[](#%5F%5Fcodelineno-5-18)  console.log(result.serverAuthCode);
[](#%5F%5Fcodelineno-5-19)};
[](#%5F%5Fcodelineno-5-20)
[](#%5F%5Fcodelineno-5-21)const handleRedirectCallback = async () => {
[](#%5F%5Fcodelineno-5-22)  if (Capacitor.getPlatform() !== 'web') {
[](#%5F%5Fcodelineno-5-23)    return;
[](#%5F%5Fcodelineno-5-24)  }
[](#%5F%5Fcodelineno-5-25)  const result = await GoogleSignIn.handleRedirectCallback();
[](#%5F%5Fcodelineno-5-26)  console.log(result.idToken);
[](#%5F%5Fcodelineno-5-27)  console.log(result.userId);
[](#%5F%5Fcodelineno-5-28)  console.log(result.email);
[](#%5F%5Fcodelineno-5-29)  console.log(result.displayName);
[](#%5F%5Fcodelineno-5-30)  console.log(result.accessToken);
[](#%5F%5Fcodelineno-5-31)  console.log(result.serverAuthCode);
[](#%5F%5Fcodelineno-5-32)};
[](#%5F%5Fcodelineno-5-33)
[](#%5F%5Fcodelineno-5-34)const signOut = async () => {
[](#%5F%5Fcodelineno-5-35)  await GoogleSignIn.signOut();
[](#%5F%5Fcodelineno-5-36)};
`

## API[¶](#api "Permanent link")

* [handleRedirectCallback()](#handleredirectcallback)
* [initialize(...)](#initialize)
* [signIn(...)](#signin)
* [signOut()](#signout)
* [Interfaces](#interfaces)

### handleRedirectCallback()[¶](#handleredirectcallback "Permanent link")

`[](#%5F%5Fcodelineno-6-1)handleRedirectCallback() => Promise<SignInResult>
`

Handle the redirect callback from the OAuth provider.

This method must be called when the app is redirected back from the OAuth provider. It exchanges the authorization code for tokens and returns the sign-in result.

Only available on Web.

**Returns:** `Promise<[SignInResult](#signinresult)>`

**Since:** 0.1.0

---

### initialize(...)[¶](#initialize "Permanent link")

`[](#%5F%5Fcodelineno-7-1)initialize(options: InitializeOptions) => Promise<void>
`

Initialize the Google Sign-In plugin.

This method must be called once before all other methods.

| Param       | Type                                    |
| ----------- | --------------------------------------- |
| **options** | [InitializeOptions](#initializeoptions) |

**Since:** 0.1.0

---

### signIn(...)[¶](#signin "Permanent link")

`[](#%5F%5Fcodelineno-8-1)signIn(options?: SignInOptions | undefined) => Promise<SignInResult>
`

Start the Google Sign-In flow.

On Web, this redirects to the Google OAuth authorization page. The promise will never resolve on Web. After the user signs in, the app will be redirected back to the `redirectUrl`. Use `handleRedirectCallback()` to complete the sign-in flow.

| Param       | Type                            |
| ----------- | ------------------------------- |
| **options** | [SignInOptions](#signinoptions) |

**Returns:** `Promise<[SignInResult](#signinresult)>`

**Since:** 0.1.0

---

### signOut()[¶](#signout "Permanent link")

`[](#%5F%5Fcodelineno-9-1)signOut() => Promise<void>
`

Sign out the current user.

On Android, this clears the credential state. On iOS, this signs out from the Google Sign-In SDK. On Web, this is a no-op.

**Since:** 0.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### SignInResult[¶](#signinresult "Permanent link")

| Prop               | Type           | Description                                                                                                                                                             | Since |
| ------------------ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **idToken**        | string         | The ID token (JWT) returned by Google. This token can be sent to your backend for verification.                                                                         | 0.1.0 |
| **userId**         | string         | The unique identifier of the user's Google Account.                                                                                                                     | 0.1.0 |
| **email**          | string \| null | The user's email address.                                                                                                                                               | 0.1.0 |
| **displayName**    | string \| null | The user's display name (full name).                                                                                                                                    | 0.1.0 |
| **givenName**      | string \| null | The user's given name (first name).                                                                                                                                     | 0.1.0 |
| **familyName**     | string \| null | The user's family name (last name).                                                                                                                                     | 0.1.0 |
| **imageUrl**       | string \| null | The URL of the user's profile picture.                                                                                                                                  | 0.1.0 |
| **accessToken**    | string \| null | The access token for accessing Google APIs. Only available when scopes are configured in initialize().                                                                  | 0.1.0 |
| **serverAuthCode** | string \| null | The server auth code that can be exchanged on your backend for access and refresh tokens. Only available on Android and iOS when scopes are configured in initialize(). | 0.1.0 |

#### InitializeOptions[¶](#initializeoptions "Permanent link")

| Prop            | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                          | Since |
| --------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **clientId**    | string     | The web client ID from Google Cloud Console. On Android, this is passed as the server client ID to the Credential Manager API and the AuthorizationClient API. On iOS, this is used as the server client ID for the Google Sign-In SDK. On Web, this is used to initialize the Google Sign-In JavaScript API. **Attention**: This must be a web client ID on all platforms, even on Android and iOS. | 0.1.0 |
| **redirectUrl** | string     | The URL to redirect to after the OAuth flow. Only available on Web.                                                                                                                                                                                                                                                                                                                                  | 0.1.0 |
| **scopes**      | string\[\] | The OAuth scopes to request. If provided, the plugin will request authorization in addition to authentication. This enables accessToken and serverAuthCode in the sign-in result.                                                                                                                                                                                                                    | 0.1.0 |

#### SignInOptions[¶](#signinoptions "Permanent link")

| Prop      | Type   | Description                                                           | Since |
| --------- | ------ | --------------------------------------------------------------------- | ----- |
| **nonce** | string | A nonce to prevent replay attacks. Only available on Android and Web. | 0.1.0 |

## Security[¶](#security "Permanent link")

This plugin handles the OAuth flow and returns tokens to your app. To keep your integration secure, be aware of the following:

* **Server-side token verification is required.** The `idToken` (JWT) is **not** verified client-side. Your backend **must** verify the JWT signature using [Google's public keys](https://www.googleapis.com/oauth2/v3/certs) before trusting any claims (e.g. `userId`, `email`). Never use client-side token data for authorization decisions without server-side verification.
* **Exchange `serverAuthCode` on your backend.** If you use scopes, send the `serverAuthCode` to your backend and exchange it there for access and refresh tokens. Never exchange it client-side, as this would expose your client secret.

## FAQ[¶](#faq "Permanent link")

### What's the difference between this plugin and other Google Sign-In plugins?[¶](#whats-the-difference-between-this-plugin-and-other-google-sign-in-plugins "Permanent link")

This plugin is purpose-built for Google Sign-In and focuses on providing a clean and modern API with the latest platform features. Here are some of the key differences:

* **Cross-platform**: Supports Android, iOS, and Web.
* **Lightweight**: No unnecessary dependencies. Just Google Sign-In, nothing else.
* **No deprecated APIs**: Uses the latest platform APIs (Credential Manager on Android, Google Sign-In SDK on iOS).
* **Authentication + Authorization**: Supports both authentication (ID tokens) and authorization (access tokens, server auth codes) in a single flow.
* **Error codes**: Provides typed error codes for proper error handling.
* **Redirect flow on Web**: Uses a redirect-based OAuth flow instead of popups, resulting in a more reliable and user-friendly experience.

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/google-sign-in/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/google-sign-in/LICENSE).

---

1. This project is not affiliated with, endorsed by, sponsored by, or approved by Google Inc. or any of their affiliates or subsidiaries. [↩](#fnref:1 "Jump back to footnote 1 in the text")

May 17, 2026 

 Back to top 