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
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Under APIs & Services, go to Credentials → Create Credentials → OAuth 2.0 Client IDs
- Choose Web application as the application type
- Set your domain under Authorized JavaScript origins
- Add your Authorized redirect URIs
- For development:
http://localhost:8090/api/oauth2-redirect
- For production:
https://yourdomain.com/api/oauth2-redirect
- For development:
- Note down your Client ID and Client Secret
2. Configure PocketBase
- Open your PocketBase admin panel
- Go to your Users table, and click Settings → Options → OAuth2
- Enable, and find Google in the list
- Enter your Google OAuth credentials:
- Client ID: Your Google Client ID
- Client Secret: Your Google Client Secret
- Save the configuration
3. Test the Integration
- Visit your application's login page
- You should see a "Continue with Google" button
- Set up other important settings in your Google Cloud Console, such as your Audience and Branding settings (required by Google before moving to production)
- Test the sign-in flow to ensure everything works correctly
Clicking the sign-in or sign-up page brings up the Google sign-in popup