Skip to content

Google OAuth setup

1. Create a Google Cloud project and OAuth client

Section titled “1. Create a Google Cloud project and OAuth client”
  1. Open Google Cloud Console and create (or select) a project.
  2. Navigate to APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID.
  3. Set the application type to Web application.

Add both of the following as Authorized redirect URIs in your OAuth client. Replace https://book.example.com with your actual APP_BASE_URL:

${APP_BASE_URL}/api/google/callback
${APP_BASE_URL}/api/google/login/callback

Both URIs must be registered — one is used for the per-user Calendar connection flow, the other for Google sign-in.

Copy the Client ID and Client Secret from the Credentials page, then set:

GOOGLE_OAUTH_CLIENT_ID=your-client-id
GOOGLE_OAUTH_CLIENT_SECRET=your-client-secret
# Strong random string shared by ALL replicas
GOOGLE_OAUTH_STATE_SECRET=<openssl rand -hex 32>

GOOGLE_OAUTH_STATE_SECRET must be the same value on every replica. Generate it with:

Terminal window
openssl rand -hex 32

TOKEN_ENCRYPTION_KEY encrypts stored Google OAuth tokens with AES-256-GCM. See the Configuration reference for details.

Each user connects their own Google account from the owner console (/me). Once connected, every new booking automatically:

  • Creates a Google Calendar event on the user’s calendar.
  • Generates a Google Meet link included in the booking confirmation.