Skip to content
Latchkey

Chromatic "Missing project token" in CI

The Chromatic CLI needs a project token to know which project to publish to. "Missing project token" means neither --project-token nor the CHROMATIC_PROJECT_TOKEN environment variable was provided to the step.

What this error means

The chromatic step fails immediately with "Missing project token" and a hint to set CHROMATIC_PROJECT_TOKEN or pass --project-token.

chromatic
✖ Missing project token
Sign in to https://www.chromatic.com/ and set CHROMATIC_PROJECT_TOKEN
or pass --project-token=<token>

Common causes

The secret is not configured in the repository

No CHROMATIC_PROJECT_TOKEN secret exists, so the env var is empty when the CLI runs.

The secret exists but is not mapped into the step env

The secret is defined but the workflow step never references it via env or an with input, so the CLI sees nothing.

How to fix it

Expose the token to the step

  1. Store the project token as a repository or organization secret.
  2. Pass it to the chromatic step as an environment variable or input.
  3. Re-run the workflow.
.github/workflows/ci.yml
- uses: chromaui/action@latest
  with:
    projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

Set the env var for a CLI call

If you invoke the CLI directly, export the token in the step environment.

.github/workflows/ci.yml
env:
  CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

How to prevent it

  • Keep the project token in CI secrets, never in committed config.
  • Reference the secret explicitly in the chromatic step.
  • Use the official chromaui/action so the token input is wired for you.

Frequently asked questions

What causes ""Missing project token""?
No CHROMATIC_PROJECT_TOKEN secret exists, so the env var is empty when the CLI runs.
How do I fix "Missing project token"?
Expose the token to the step

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card