{"record":{"id":"f6bf6f45ba1a5e1e","repo":"koala73/worldmonitor","slug":"dodo-dodo-api-key-is-not-set-set-it-in-the-conv","errorCode":null,"errorMessage":"[dodo] DODO_API_KEY is not set. Set it in the Convex dashboard environment variables.","messagePattern":"\\[dodo\\] DODO_API_KEY is not set\\. Set it in the Convex dashboard environment variables\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/lib/dodo.ts","lineNumber":59,"sourceCode":"  DodoPayments[\"checkoutSessions\"][\"create\"]\n>[0];\n\nexport interface CheckoutSessionResult {\n  checkout_url: string;\n}\n\n/**\n * Client options for the checkout-session client, exported as a pure function\n * so tests can assert the retry contract without network access. maxRetries: 0\n * is load-bearing — see the module header; deleting it reintroduces nested\n * provider retries under the action ladder.\n */\nexport function buildCheckoutClientOptions(env: {\n  DODO_API_KEY?: string;\n  DODO_PAYMENTS_ENVIRONMENT?: string;\n}): ConstructorParameters<typeof DodoPayments>[0] {\n  if (!env.DODO_API_KEY) {\n    throw new Error(\n      \"[dodo] DODO_API_KEY is not set. \" +\n        \"Set it in the Convex dashboard environment variables.\",\n    );\n  }\n  const isLive = env.DODO_PAYMENTS_ENVIRONMENT === \"live_mode\";\n  return {\n    bearerToken: env.DODO_API_KEY,\n    ...(isLive ? {} : { environment: \"test_mode\" as const }),\n    maxRetries: 0,\n    timeout: CHECKOUT_PROVIDER_ATTEMPT_TIMEOUT_MS,\n  };\n}\n\n/**\n * Create one checkout session — exactly one HTTP request (no SDK-internal\n * retries). Throws the SDK's typed APIError on failure (status 429 for rate\n * limits, classified by payments/checkoutRateLimit.ts).\n */","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/convex/lib/dodo.ts#L41-L77","documentation":"Configuration gate in buildCheckoutClientOptions: the env object has no DODO_API_KEY, so the DodoPayments checkout client cannot be constructed. Fails fast before any checkout request; note maxRetries:0 is load-bearing, so the SDK must never be constructed with a placeholder key to try anyway.","triggerScenarios":"Thrown at convex/lib/dodo.ts:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DODO_API_KEY in the Convex dashboard environment variables","Add the env check to deployment verification so checkout is never enabled without the key"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}