PocketStarter Docs

Google OAuth Setup

By default, PocketStarter enables Google OAuth. In our experience, offering Google sign-in can increase sign-up conversion rates by up to 50%, as many users are already familiar with this method.

Prerequisites

Before setting up Google OAuth, you'll need:

  • A Google Cloud Platform account
  • A Google Cloud project with the Google+ API enabled

Setup Steps

1. Create Google OAuth Credentials

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Under APIs & Services, go to CredentialsCreate CredentialsOAuth 2.0 Client IDs
  4. Choose Web application as the application type
  5. Set your domain under Authorized JavaScript origins
  6. Add your Authorized redirect URIs
    • For development: http://localhost:8090/api/oauth2-redirect
    • For production: https://yourdomain.com/api/oauth2-redirect
  7. Note down your Client ID and Client Secret

2. Configure PocketBase

  1. Open your PocketBase admin panel
  2. Go to your Users table, and click SettingsOptionsOAuth2
  3. Enable, and find Google in the list
  4. Enter your Google OAuth credentials:
    • Client ID: Your Google Client ID
    • Client Secret: Your Google Client Secret
  5. Save the configuration

3. Test the Integration

  1. Visit your application's login page
  2. You should see a "Continue with Google" button
  3. Set up other important settings in your Google Cloud Console, such as your Audience and Branding settings (required by Google before moving to production)
  4. Test the sign-in flow to ensure everything works correctly

Google OAuth popup

Clicking the sign-in or sign-up page brings up the Google sign-in popup