koala73/worldmonitor · error · Error

[dodo] DODO_API_KEY is not set. Set it in the Convex dashboa

Error message

[dodo] DODO_API_KEY is not set. Set it in the Convex dashboard environment variables.

What it means

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.

Source

Thrown at convex/lib/dodo.ts:59

  DodoPayments["checkoutSessions"]["create"]
>[0];

export interface CheckoutSessionResult {
  checkout_url: string;
}

/**
 * Client options for the checkout-session client, exported as a pure function
 * so tests can assert the retry contract without network access. maxRetries: 0
 * is load-bearing — see the module header; deleting it reintroduces nested
 * provider retries under the action ladder.
 */
export function buildCheckoutClientOptions(env: {
  DODO_API_KEY?: string;
  DODO_PAYMENTS_ENVIRONMENT?: string;
}): ConstructorParameters<typeof DodoPayments>[0] {
  if (!env.DODO_API_KEY) {
    throw new Error(
      "[dodo] DODO_API_KEY is not set. " +
        "Set it in the Convex dashboard environment variables.",
    );
  }
  const isLive = env.DODO_PAYMENTS_ENVIRONMENT === "live_mode";
  return {
    bearerToken: env.DODO_API_KEY,
    ...(isLive ? {} : { environment: "test_mode" as const }),
    maxRetries: 0,
    timeout: CHECKOUT_PROVIDER_ATTEMPT_TIMEOUT_MS,
  };
}

/**
 * Create one checkout session — exactly one HTTP request (no SDK-internal
 * retries). Throws the SDK's typed APIError on failure (status 429 for rate
 * limits, classified by payments/checkoutRateLimit.ts).
 */

View on GitHub (pinned to eeab0a219f)

Solutions

  1. Set DODO_API_KEY in the Convex dashboard environment variables
  2. Add the env check to deployment verification so checkout is never enabled without the key
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at convex/lib/dodo.ts:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of koala73/worldmonitor@eeab0a219f (2026-08-21). Data as JSON: /api/errors/f6bf6f45ba1a5e1e. Report an issue: GitHub.