> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rocket.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Google sign-in for APK

> Configure Google sign-in for Android APKs built with Rocket.new - set up Google Cloud Console and Supabase OAuth.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

<Info>
  Configure Google Cloud Console and Supabase so Google sign-in works in your Android APK. This guide covers creating OAuth credentials, configuring Supabase, and updating your app configuration.
</Info>

<Warning>
  **APK only:** When Google auth is configured through Supabase, Google sign-in will not work in Rocket's preview or in published web apps. It will only work in a downloaded APK installed on a real device or emulator.
</Warning>

## Your SHA-1 Certificate Fingerprint

Rocket generates a unique SHA-1 fingerprint for your app. You will need it in **Step 1c** below.

**To find it:**

<Steps>
  <Step title="Open the Launch popup">
    In your Rocket project, click **Launch** in the top-right corner.
  </Step>

  <Step title="Go to the APK tab">
    Click the **APK** tab.
  </Step>

  <Step title="Copy the SHA-1 key">
    Your SHA-1 key is shown at the top of the tab. Click the copy icon next to it.
  </Step>
</Steps>

<Warning>
  Use copy-paste only - do not type this manually. A single wrong character will prevent users from signing in.
</Warning>

<Frame caption="SHA-1 key shown in the APK tab of the Launch popup.">
  <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/supabase/google-sign-in/sha1-rocket-dashboard-light.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=9a751011a9d498c2a031d8137363da88" alt="APK tab in the Rocket Launch popup showing the SHA-1 certificate fingerprint with a copy button." className="theme-image light-image" width="852" height="674" data-path="images/build-docs/connectors/supabase/google-sign-in/sha1-rocket-dashboard-light.webp" />

  <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/kMglG6b8Pajovz_G/images/build-docs/connectors/supabase/google-sign-in/sha1-rocket-dashboard-dark.webp?fit=max&auto=format&n=kMglG6b8Pajovz_G&q=85&s=62925b5a79502d0b66e65cc3ceca52ef" alt="APK tab in the Rocket Launch popup showing the SHA-1 certificate fingerprint with a copy button." className="theme-image dark-image" width="854" height="670" data-path="images/build-docs/connectors/supabase/google-sign-in/sha1-rocket-dashboard-dark.webp" />
</Frame>

## Step 1 - Google Cloud Console

### 1a. Create or select your project

<Steps>
  <Step title="Open Google Cloud Console">
    Go to [console.cloud.google.com](https://console.cloud.google.com) and sign in.
  </Step>

  <Step title="Select or create a project">
    Click the project selector at the top of the page. Select your existing project, or click **New Project**, give it a name, and click **Create**.
  </Step>
</Steps>

### 1b. Set up the OAuth Consent Screen

This is the screen your users see when Google asks for permission to share their account details with your app.

<Steps>
  <Step title="Open OAuth consent screen">
    In the sidebar, go to **APIs & Services > OAuth consent screen** and click **Get Started**.
  </Step>

  <Step title="Fill in app details">
    Fill in **App name** and **User support email**, then click **Next**.
  </Step>

  <Step title="Select user type">
    Select **External** and click **Next**.
  </Step>

  <Step title="Add developer contact">
    Fill in your **Developer contact email** and click **Next**.
  </Step>

  <Step title="Create the consent screen">
    Click **Create**.

    <Note>
      Leave the app in **Testing** mode for now. Add your own Google account as a test user so you can sign in during testing.
    </Note>
  </Step>
</Steps>

### 1c. Create the Android OAuth Client ID

This credential identifies your app to Google during sign-in.

<Steps>
  <Step title="Create a new OAuth client ID">
    Go to **APIs & Services > Credentials** and click **+ Create Credentials > OAuth client ID**.
  </Step>

  <Step title="Set application type to Android">
    Set **Application type** to **Android**.
  </Step>

  <Step title="Fill in the credential details">
    Fill in the following:

    | Field                             | Value                                                                                                          |
    | --------------------------------- | -------------------------------------------------------------------------------------------------------------- |
    | **Name**                          | e.g. `MyApp Android`                                                                                           |
    | **Package name**                  | Copy the `namespace` value from `android/app/build.gradle.kts` in your project (e.g. `com.example.zebralover`) |
    | **SHA-1 certificate fingerprint** | Paste the value you copied from Rocket's **Launch** tab (see above)                                            |
  </Step>

  <Step title="Save the credential">
    Click **Create**, then **OK**.
  </Step>
</Steps>

### 1d. Create the Web OAuth Client ID

Supabase requires a separate Web Client ID to handle authentication on your behalf.

<Steps>
  <Step title="Create a new OAuth client ID">
    Click **+ Create Credentials > OAuth client ID** again.
  </Step>

  <Step title="Set application type to Web">
    Set **Application type** to **Web application**. Name it e.g. `MyApp Web (Supabase)`.
  </Step>

  <Step title="Add the redirect URI">
    Under **Authorised redirect URIs**, click **+ Add URI** and enter:

    ```plaintext wrap theme={null}
    https://<your-project-ref>.supabase.co/auth/v1/callback
    ```

    Replace `<your-project-ref>` including `<` and `>` with your **Project ID**, found in Supabase under **Settings > General**.
  </Step>

  <Step title="Create and copy credentials">
    Click **Create**. A dialog shows your **Client ID** and **Client Secret**. Copy and save both values - you will need them in **Step 2**.

    <Warning>
      Keep your Client Secret private. Never share it publicly or include it in your app's code.
    </Warning>
  </Step>
</Steps>

## Step 2 - Configure Supabase

### 2a. Enable Google Sign-In

<Steps>
  <Step title="Open your Supabase project">
    Log in to [supabase.com](https://supabase.com) and open your project.
  </Step>

  <Step title="Navigate to Providers">
    Go to **Authentication > Providers** in the sidebar.
  </Step>

  <Step title="Enable Google sign-in">
    Find **Google**, click to expand it, and toggle **Enable sign in with Google** to **ON**.
  </Step>

  <Step title="Enter credentials and save">
    Paste the **Web Client ID** and **Client Secret** you saved in **Step 1d**. Click **Save**.
  </Step>
</Steps>

### 2b. Add the redirect URL

<Steps>
  <Step title="Open URL Configuration">
    In the sidebar, go to **Authentication > URL Configuration**.
  </Step>

  <Step title="Add the redirect URL">
    Under **Redirect URLs**, click **Add URL** and enter:

    ```plaintext wrap theme={null}
    com.yourcompany.appname://login-callback
    ```

    Replace `com.yourcompany.appname` with your `namespace` value from `android/app/build.gradle.kts`.
  </Step>

  <Step title="Save the configuration">
    Click **Save**.
  </Step>
</Steps>

## Step 3 - Update Your App Configuration

In Rocket, open **Code** and find `env.json` in the root folder of your project. Find the `GOOGLE_WEB_CLIENT_ID` field and replace the placeholder with the **Web Client ID** you copied in **Step 1d**.

```json wrap theme={null}
{
    "SUPABASE_URL": "...",
    "SUPABASE_ANON_KEY": "...",
    "OPENAI_API_KEY": "...",
    "GEMINI_API_KEY": "...",
    "ANTHROPIC_API_KEY": "...",
    "PERPLEXITY_API_KEY": "...",
    "GOOGLE_WEB_CLIENT_ID": "your_google_web_client_id"
}
```

<Warning>
  Paste the Web Client ID exactly as copied from the **Step 1d** dialog. It ends with `.apps.googleusercontent.com`.
</Warning>

## You Are All Set

Go back to Rocket, click **Build APK**, and download your APK once the build is complete.

<Card icon="rocket" horizontal title="Google sign-in is ready">
  Google Cloud Console, Supabase, and your app are configured. Google sign-in will now work in your APK.
</Card>

***

## What's next?

<CardGroup cols={2}>
  <Card title="Social auth" icon="users" href="/build/connectors/supabase/social-auth">
    Add more OAuth providers like GitHub, Apple, or Discord.
  </Card>

  <Card title="Supabase overview" icon="database" href="/build/connectors/supabase/overview">
    See all Supabase features available in Rocket.
  </Card>
</CardGroup>
