Applitools Eyes API key missing / invalid in CI
The Eyes SDK authenticates to the Applitools cloud with an API key. If APPLITOOLS_API_KEY is unset or invalid in the job, eyes.open() fails before any checkpoint is captured.
What this error means
The test fails with "Eyes API key is not set. Set it via APPLITOOLS_API_KEY or Eyes.setApiKey()" or an unauthorized error when opening Eyes. It runs fine locally where the key is exported.
com.applitools.eyes.EyesException: API key is missing! Please set it using
Eyes.setApiKey() or the APPLITOOLS_API_KEY environment variable.Common causes
APPLITOOLS_API_KEY not exposed to the job
The key is stored as a secret but not mapped into the step environment, so the SDK reads an empty value.
Secret absent on forked pull requests
Fork-triggered workflows do not receive secrets, so the API key is empty on those runs.
How to fix it
Map the API key from a secret
Set APPLITOOLS_API_KEY from the repository secret on the job or step that runs the visual tests.
env:
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}Skip or gate on forks
Guard the Eyes step so it does not run (and fail) when the secret is unavailable on a forked PR.
- run: mvn test -Pvisual
if: ${{ env.APPLITOOLS_API_KEY != '' }}How to prevent it
- Store the Applitools key as a repository or organization secret.
- Map it into every job that opens Eyes.
- Handle forked PRs, where secrets are not provided.