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.
✖ 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
- Store the project token as a repository or organization secret.
- Pass it to the chromatic step as an environment variable or input.
- Re-run the workflow.
- 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.
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.