{"record":{"id":"395255612c1f6c05","repo":"medusajs/medusa","slug":"google-clientid-is-required","errorCode":null,"errorMessage":"Google clientId is required","messagePattern":"Google clientId is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/providers/auth-google/src/services/google.ts","lineNumber":42,"sourceCode":"type InjectedDependencies = {\n  logger: Logger\n}\n\nconst GOOGLE_JWKS_URI = \"https://www.googleapis.com/oauth2/v3/certs\"\nconst GOOGLE_ISSUERS = [\"https://accounts.google.com\", \"accounts.google.com\"]\n\ninterface LocalServiceConfig extends GoogleAuthProviderOptions {}\nexport class GoogleAuthService extends AbstractAuthModuleProvider {\n  static identifier = \"google\"\n  static DISPLAY_NAME = \"Google Authentication\"\n\n  protected config_: LocalServiceConfig\n  protected logger_: Logger\n  protected jwks_: JwksClient\n\n  static validateOptions(options: GoogleAuthProviderOptions) {\n    if (!options.clientId) {\n      throw new Error(\"Google clientId is required\")\n    }\n\n    if (!options.clientSecret) {\n      throw new Error(\"Google clientSecret is required\")\n    }\n\n    if (!options.callbackUrl) {\n      throw new Error(\"Google callbackUrl is required\")\n    }\n  }\n\n  constructor(\n    { logger }: InjectedDependencies,\n    options: GoogleAuthProviderOptions\n  ) {\n    // @ts-ignore\n    super(...arguments)\n    this.config_ = options","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-google/src/services/google.ts#L24-L60","documentation":"The Google auth provider's `validateOptions` runs at startup and requires a `clientId` from a Google OAuth client. Without it the provider cannot start the OAuth flow and Medusa fails to boot.","triggerScenarios":"Registering auth-google in medusa-config without `clientId` or with an unset GOOGLE_CLIENT_ID env var.","commonSituations":"Google Cloud OAuth client not created yet, credentials not added to the deployment environment, or env var naming mismatch.","solutions":["Create an OAuth 2.0 client in Google Cloud Console and set clientId in options from an env var","Confirm the env var is defined where Medusa runs (local .env and deployment secrets)"],"exampleFix":"// before\n{ id: 'google', resolve: '@medusajs/auth-google', options: {} }\n// after\n{ id: 'google', resolve: '@medusajs/auth-google', options: { clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, callbackUrl: `${process.env.MEDUSA_BACKEND_URL}/auth/google/google/callback` } }","handlingStrategy":"validation","validationCode":"if (!process.env.GOOGLE_CLIENT_ID) {\n  throw new Error('GOOGLE_CLIENT_ID is required for the google auth provider')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create the OAuth client before enabling the module","Validate env at deploy time"],"tags":["google","oauth","auth-provider","module-config","startup"],"backgroundTag":"oauth-provider-misconfigured","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}