Skip to content
Latchkey

Chromatic "Missing project token" (CHROMATIC_PROJECT_TOKEN) in CI

The Chromatic CLI needs a project token to associate the uploaded Storybook build with your project. Without --project-token or CHROMATIC_PROJECT_TOKEN, it cannot start and reports a missing token.

What this error means

The chromatic step fails early with "Missing project token" or "Failed to authenticate." No build is uploaded and no snapshots are captured.

Chromatic
x Missing project token
  Sign in to https://www.chromatic.com/ to get your project token,
  then set CHROMATIC_PROJECT_TOKEN or pass --project-token.

Common causes

The token is not set in the job

The project token secret is not mapped into the step environment, so the CLI has nothing to authenticate with.

The secret is missing on forked PRs

Fork-triggered runs do not receive secrets, so Chromatic has no token on those events.

How to fix it

Provide the project token

Set CHROMATIC_PROJECT_TOKEN from a secret, or pass --project-token.

.github/workflows/ci.yml
- run: npx chromatic --project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }}

Use the official action

The Chromatic GitHub Action reads the token from an input or secret and handles the upload.

.github/workflows/ci.yml
- uses: chromaui/action@latest
  with:
    projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

How to prevent it

  • Store the Chromatic project token as a secret.
  • Pass it via --project-token or CHROMATIC_PROJECT_TOKEN in every run.
  • Account for forked PRs where secrets are unavailable.

Frequently asked questions

What causes ""Missing project token""?
The project token secret is not mapped into the step environment, so the CLI has nothing to authenticate with.
How do I fix "Missing project token"?
Set CHROMATIC_PROJECT_TOKEN from a secret, or pass --project-token.

Related guides

References

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