{"record":{"id":"78911b97b1918bf7","repo":"medusajs/medusa","slug":"github-clientid-is-required","errorCode":null,"errorMessage":"Github clientId is required","messagePattern":"Github clientId is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/providers/auth-github/src/services/github.ts","lineNumber":29,"sourceCode":"  MedusaError,\n} from \"@medusajs/framework/utils\"\n\ntype InjectedDependencies = {\n  logger: Logger\n}\n\ninterface LocalServiceConfig extends GithubAuthProviderOptions {}\n\nexport class GithubAuthService extends AbstractAuthModuleProvider {\n  static identifier = \"github\"\n  static DISPLAY_NAME = \"Github Authentication\"\n\n  protected config_: LocalServiceConfig\n  protected logger_: Logger\n\n  static validateOptions(options: GithubAuthProviderOptions) {\n    if (!options.clientId) {\n      throw new Error(\"Github clientId is required\")\n    }\n\n    if (!options.clientSecret) {\n      throw new Error(\"Github clientSecret is required\")\n    }\n\n    if (!options.callbackUrl) {\n      throw new Error(\"Github callbackUrl is required\")\n    }\n  }\n\n  constructor(\n    { logger }: InjectedDependencies,\n    options: GithubAuthProviderOptions\n  ) {\n    // @ts-ignore\n    super(...arguments)\n    this.config_ = options","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-github/src/services/github.ts#L11-L47","documentation":"The Github auth provider's static `validateOptions` runs at module load/registration time and requires a `clientId`. Without it the provider cannot initiate the OAuth flow, so Medusa throws during startup.","triggerScenarios":"Configuring the auth-github provider in medusa-config without `clientId` (or with an unset GITHUB_CLIENT_ID env var).","commonSituations":"Missing OAuth app credentials in the environment, creating a Github OAuth app but forgetting to copy the client id, or env var name mismatch between .env and config.","solutions":["Create a Github OAuth app and set clientId in the provider options","Ensure the env var is loaded: `clientId: process.env.GITHUB_CLIENT_ID` and that .env defines it","Redeploy with updated environment secrets"],"exampleFix":"// before\n{ resolve: '@medusajs/auth-github', id: 'github', options: {} }\n// after\n{ resolve: '@medusajs/auth-github', id: 'github', options: { clientId: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET, callbackUrl: `${process.env.MEDUSA_BACKEND_URL}/auth/github/callback` } }","handlingStrategy":"validation","validationCode":"if (!process.env.GITHUB_CLIENT_ID) {\n  throw new Error('GITHUB_CLIENT_ID is required for the github auth provider')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a config validation step at deploy time","Store OAuth credentials in the platform's secret manager","Add integration tests that boot with the provider configured"],"tags":["github","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"}