ENGLISH·COURSE API
    Preparing search index...
    • Whether draft courses are served in the given environment.

      Parameters

      Returns boolean

      true when draft courses are part of the served catalog

      SHOW_DRAFT_COURSES Result
      unset or empty NODE_ENV !== "production"
      1, true (any case) shown
      0, false (any case) hidden
      anything else throws InvalidDraftVisibilityError

      The default is what makes the flag free to live with: pnpm dev, pnpm test:run, Storybook and Playwright against a dev server all see draft courses with no configuration, while a production build hides them. The explicit values cover the two cases the default cannot — reviewing a draft in a production build, and checking the production catalog locally.

      Takes the environment as an argument rather than reading process.env, so the whole decision table is testable without mutating the real environment.

      InvalidDraftVisibilityError when the flag is set to an unrecognized value