Integrations

Google Sign-In

Let people sign in to your Capacity app with their Google account, through Clerk or Supabase Auth: the Google credentials to create and where to paste them.

Your app can offer "Continue with Google" next to, or instead of, e-mail and password. There are two ways to get there, and which one you take depends on what handles sign-in in your app.

Your app's sign-in runs onWhat to do
Clerk, installed from ExtensionsTurn Google on in Clerk's dashboard, under its social connections. Clerk's own guide covers the Google side.
Supabase Auth, with the project connected to SupabaseFollow this page.

No sign-in yet? Start with one of the two, then come back.

With Supabase Auth

The agent writes the app's side: the button, the redirect, the session. You create the Google credentials and paste them in Supabase, because only you can do that in your own accounts.

Step 1: Ask for it

Add a "Continue with Google" option to the sign-in and sign-up pages, in addition to e-mail and password.

Step 2: Create a Google Cloud project

  1. Open the Google Cloud Console.
  2. Create a project, or select an existing one from the menu at the top.

The consent screen is what your users see when Google asks them to confirm.

  1. Open the consent screen page.

  2. Give the app a name and a support e-mail.

  3. For the audience, choose External.

    Choosing External as the audience in the Google Cloud Console
  4. Add a contact e-mail, accept Google's terms and click Create.

  5. Under Branding → Authorized domains, add your Supabase project's domain, <project-id>.supabase.co. You find it in Supabase under Settings → Data API.

  6. Under Data Access, add these three scopes, then save: .../auth/userinfo.email, .../auth/userinfo.profile, openid.

    The three scopes in the Google Cloud Console

Step 4: Create the credentials

  1. Open the Credentials page, click Create credentials and choose OAuth client ID.

  2. Application type: Web application.

  3. Under Authorized JavaScript origins, add the addresses of your app: its capacity.studio address, its preview address, and your custom domain if you have one. They are listed in your project under Settings → Domains.

    Authorized JavaScript origins in the Google Cloud Console
  4. Under Authorized redirect URIs, paste the callback address Supabase gives you: in the Supabase dashboard, Authentication → Providers → Google. It looks like https://<project-id>.supabase.co/auth/v1/callback.

    The callback URL in the Google provider settings of Supabase
  5. Click Create and copy the Client ID and the Client Secret.

Step 5: Turn Google on in Supabase

In the Supabase dashboard, open Authentication → Providers → Google, enable it, paste the Client ID and the Client Secret, and save.

The Google provider enabled in Supabase with its client ID and secret

Step 6: Test

Google does not show its sign-in page inside the editor's preview. In the preview toolbar, click Open in a new tab, then:

  1. Go to your sign-in page.
  2. Click Continue with Google and choose an account.
  3. Check that you land back in your app, signed in.

Troubleshooting

"redirect_uri_mismatch". The redirect URI in Google must be exactly the callback address from Supabase.

The button does nothing. Check that the Google provider is enabled in Supabase and that the ID and the secret were pasted whole.

It works in the preview but not on my domain. Add the domain to Authorized JavaScript origins in Google, and to the redirect addresses in Supabase under Authentication → URL Configuration.

Signed in, but sent to the wrong page. Tell the agent where a user should land after signing in.

Paste any error in the chat: the agent can read the Supabase auth logs.

Help

Google's OAuth 2.0 documentation covers the Google side. For your app, ask in the project's chat or open the Help chat on capacity.so.