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

# Google Sign-In Integration

> Step-by-step guide to add Google Sign-In to your Readdy project using Supabase

## What you need before you start

**Accounts & project info**

1. A [**Google Cloud**](https://console.cloud.google.com) account (to create the OAuth app)
2. A [**Supabase**](https://supabase.com/) project (you can create a new one; the free tier is fine)
3. A **Readdy** project (to build and publish your site)
4. Before going live, prepare links to your **Privacy Policy** and **Terms of Service** to add to the Google consent screen.

## Create and configure OAuth in Google Cloud

**Goal:** Obtain the **Client ID** and **Client Secret**, allow sign-in from your site, and hand off the OAuth callback to **Supabase**.

<Steps>
  <Step title="Step 1: Create a Google Cloud Platform project">
    Open [**Google Cloud Console**](https://console.cloud.google.com) and sign in to your Google account.

    Click the project selector at the top → click **"New Project"** → enter a **Project name** → **Create**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-new-project.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=0109490e8052b2cbfa22b827ec2e2d76" width="1280" height="709" data-path="images/google-new-project.png" />
    </Frame>

    Enter a project name and click **Create**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-project-name.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=50c42ec0a173d0de34e4af38f26f310a" width="3456" height="1916" data-path="images/google-project-name.png" />
    </Frame>

    Enter a project name.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-project-created.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=9739f70533ede94e1e95636de8aac8a6" width="3456" height="1916" data-path="images/google-project-created.png" />
    </Frame>
  </Step>

  <Step title="Step 2: Configure the OAuth consent screen">
    Click **Select project**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-select-project.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=499958e0f63ce93448a95ac2d4c9eb88" width="3456" height="1916" data-path="images/google-select-project.png" />
    </Frame>

    Click your project name to select it.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-project-selected.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=4338824075567c1b00e6db205a5aca29" width="3456" height="1916" data-path="images/google-project-selected.png" />
    </Frame>

    Click the hamburger menu (top-left). Hover **APIs & Services**, then click **OAuth consent screen**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-oauth-consent.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=fef6cfe0af14c9dc55e5259949dbadc5" width="3456" height="1916" data-path="images/google-oauth-consent.png" />
    </Frame>

    Click **Branding**, then **Get started**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-branding.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=b33055a3b4742c6d6842cb109b2b0448" width="3456" height="1916" data-path="images/google-branding.png" />
    </Frame>

    Fill in: **App name**, **User support email**, **Audience**, **Contact information**, then click **Create**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-app-details.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=c0989c6bfa11b905a1b22a680fe100f8" width="3456" height="1916" data-path="images/google-app-details.png" />
    </Frame>

    Add a **Logo**, your **domain**, and the **Authorized domains**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-logo-domain.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=4e13f7cd7de3168e20c8c1d1df45bcc9" width="1433" height="1468" data-path="images/google-logo-domain.png" />
    </Frame>

    Click **Add user** to add test users. When testing is complete, you can click **Publish app** to move to production.

    <Frame>
      <img src="https://mintcdn.com/readdy/NjypJwJxP_8VFM5C/images/google-test-users.png?fit=max&auto=format&n=NjypJwJxP_8VFM5C&q=85&s=2c6178516398d699abb524bbd0e020f3" width="3456" height="1916" data-path="images/google-test-users.png" />
    </Frame>

    Click **Data Access**, then **Add or remove scopes**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-data-access.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=f4828ef76a4527e7b7e201c38c0b7ae4" width="3456" height="1916" data-path="images/google-data-access.png" />
    </Frame>

    Choose the scopes your app needs. In most cases, only **email**, **profile**, and **openid** are required. Select any others as needed.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-scopes.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=d234b147956ae5f8bc9a8c838d70e31b" width="3456" height="1916" data-path="images/google-scopes.png" />
    </Frame>
  </Step>

  <Step title="Step 3: Create an OAuth client (Web application)">
    Click **Clients**, then **Create client**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-create-client.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=586a92ed157298213a6ac794f4e7f7ee" width="3456" height="1916" data-path="images/google-create-client.png" />
    </Frame>

    For **Application type**, choose **Web application**. Enter a **Name**, and add **Authorized redirect URIs**.

    <Frame>
      <img src="https://mintcdn.com/readdy/NjypJwJxP_8VFM5C/images/google-web-application.png?fit=max&auto=format&n=NjypJwJxP_8VFM5C&q=85&s=79050288f0d2081b1911fa7afb3d094c" width="3456" height="1916" data-path="images/google-web-application.png" />
    </Frame>

    Click **Create**. Your OAuth client is created—save the **Client ID** and **Client secret**.

    <Frame>
      <img src="https://mintcdn.com/readdy/7CjKFJLvlZkkuEbB/images/google-client-credentials.png?fit=max&auto=format&n=7CjKFJLvlZkkuEbB&q=85&s=75cfadb3eb2e1070dd907d036de1687e" width="3456" height="1916" data-path="images/google-client-credentials.png" />
    </Frame>
  </Step>
</Steps>

### How to get the Authorized redirect URIs

<Steps>
  <Step title="Get Supabase Callback URL">
    Sign in to **Supabase** and create a project.

    In the left sidebar, click **Authentication**.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-auth.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=c68e444e5eda123ac0df9b1147893b9f" width="3454" height="1916" data-path="images/supabase-auth.png" />
    </Frame>

    Click **Sign In / Providers**, then on the right click **Google**.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-google-provider.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=045e02b96559b5dc674ffd3ebdc52507" width="3456" height="1916" data-path="images/supabase-google-provider.png" />
    </Frame>

    Copy the **Callback URL** and paste it into **Authorized redirect URIs** in Google Cloud.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-callback-url.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=4f43502ba145aebc67186ac8a3488104" width="3456" height="1916" data-path="images/supabase-callback-url.png" />
    </Frame>
  </Step>
</Steps>

## Enable Google Sign-In in Supabase

<Steps>
  <Step title="Step 1: Access Supabase Dashboard">
    Open the [**Supabase Dashboard**](https://supabase.com/) and enter your project.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-dashboard.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=750cac236b70f2ef1c3acdd2c7232ef4" width="3456" height="1916" data-path="images/supabase-dashboard.png" />
    </Frame>
  </Step>

  <Step title="Step 2: Configure Google Provider">
    In the left sidebar, click **Authentication** → **Sign In / Providers**, then on the right click **Google**.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-auth-providers.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=a843f4b7a38d8b901fb8d76c0bec74e1" width="3456" height="1916" data-path="images/supabase-auth-providers.png" />
    </Frame>

    In **Client ID** / **Client Secret**, paste the values you copied from Google → click **Save**.

    <Frame>
      <img src="https://mintcdn.com/readdy/XM6zx4Mq-XYNJTgS/images/supabase-google-config.png?fit=max&auto=format&n=XM6zx4Mq-XYNJTgS&q=85&s=21e23d2cb103a4093559d368f89dc407" width="3456" height="1916" data-path="images/supabase-google-config.png" />
    </Frame>
  </Step>
</Steps>

## Connect Supabase inside Readdy

**Goal:** Link your Readdy project to your Supabase project and generate a page with Google Sign-In.

<Steps>
  <Step title="Step 1: Connect Supabase">
    Connect your Supabase project to Readdy. See "How to connect Supabase" in Readdy for detailed instructions.

    <Warning>
      Make sure you connect the **same Supabase project** where you enabled **Google Authentication**.
    </Warning>
  </Step>

  <Step title="Step 2: Generate login/registration UI">
    In Readdy, enter the following prompt:

    ```
    To make a login and registration function, need to connect to Google Login.
    ```

    This will generate the necessary UI components for Google Sign-In.
  </Step>

  <Step title="Step 3: Test the integration">
    In Readdy, click **Share Link** and open the site's login page → click **"Continue with Google"** → choose an account and authorize.

    After a successful login, you should be redirected back to the **SITE URL**.

    In **Supabase → Authentication → Users**, you should see the newly created user record.
  </Step>
</Steps>

## Troubleshooting

<Accordion title="Common Issues">
  **Issue:** "Error 400: redirect\_uri\_mismatch"

  * **Solution:** Make sure the callback URL in Google Cloud exactly matches the one in Supabase (including https/http and trailing slashes)

  **Issue:** "This app isn't verified"

  * **Solution:** This is normal during development. Click "Advanced" → "Go to \[app name] (unsafe)" to continue testing

  **Issue:** Users not appearing in Supabase

  * **Solution:** Check that you're using the same Supabase project in both the Google Cloud configuration and Readdy connection
</Accordion>

<Accordion title="Next Steps">
  Once Google Sign-In is working:

  1. **Add user profile management** - Allow users to update their profile information
  2. **Implement role-based access control** - Set up different user permissions
  3. **Set up email notifications** - Send welcome emails and notifications
  4. **Configure additional OAuth providers** - Add Facebook, Twitter, or other login options

  Choose the features that best fit your application's needs.
</Accordion>
