Keys / Snyk
SNYK_TOKEN
The Snyk token the Snyk CLI scans with in CI: a personal access token, a service account token or a legacy API token.
- Expires
- you choose, up to 90 days, for personal access tokens
- API
- list and revoke personal access tokens; no create
Get it
Create one on app.snyk.io/account/personal-access-tokens. The steps aren't recorded yet.
Set it
SNYK_TOKEN=...
The Snyk CLI reads it on its own. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Personal access token: generate a new one. You can have three active at once, so the old one keeps working.
- Service account (Enterprise plans): create a new service account with the same role.
- Deploy the new token everywhere that reads
SNYK_TOKEN, and check that nothing still uses the old one. - Then revoke the old personal access token, or delete the old service account. Either stops the old token at once.
- Legacy API token: Revoke & Regenerate in General Account Settings stops the old token at once, so deploy the new one right away.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.