Create the OAuth client
-
Open the Google API Console and select or create a project. From the dashboard, choose Enable APIs and Services.
-
Search for calendar and select the Google Calendar API.
-
Enable it.
-
Go to the OAuth consent screen, pick the app type (Internal or External) and fill in the basic details.
-
Under Scopes, choose Add or Remove Scopes and add:
.../auth/calendar.events.../auth/calendar.readonly
-
Under Test Users, add the Google accounts you will use, then finish the wizard.
-
Go to Credentials → Create Credentials → OAuth Client ID.
-
Choose Web Application as the application type.
-
Add both authorized redirect URIs, replacing
<flexcal URL>with your instance URL:<flexcal URL>/api/integrations/googlecalendar/callback<flexcal URL>/api/auth/callback/google -
Select the new client under OAuth 2.0 Client IDs and Download JSON. Paste the entire JSON string as the value of
GOOGLE_API_CREDENTIALSin both.envand.env.appStore:GOOGLE_API_CREDENTIALS={"web":{"client_id":"...","client_secret":"...", ...}}
Google sign-in
The same OAuth client backs “Sign in with Google”. To keep the integration internal — calendar connection only, no Google login — set:
GOOGLE_LOGIN_ENABLED=falsePublish the consent screen
An External consent screen in Testing mode only works for the accounts you listed as test users, and tokens expire after a week. Under OAuth consent screen, click PUBLISH APP once you are ready to use it for real.
Add the app to the app store
bun run --cwd packages/prisma seed-app-store