Keys / SonarQube Cloud

SONAR_TOKEN

The SonarQube Cloud token your CI runs code analysis with. Scripts call the Web API with it too.

Expires
you choose; with no expiry, it ends after 60 days unused
API
create, list and revoke, with the Web API

Get it

Create one on sonarcloud.io/account/access-tokens. The steps aren't recorded yet.

Set it

SONAR_TOKEN=...

The SonarScanner CLI and the npm scanner read it when you don't pass sonar.token. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Generate a new token. Organization admins on the Team plan and up can create a Scoped Organization Token with the same projects and permissions; it starts with sqco_ and stays when its creator leaves. Users signed in with GitHub can create a personal token under My account > Access tokens. Either is shown once.
  2. Put it in every CI secret named SONAR_TOKEN.
  3. Check that analyses still run, then revoke the old token.
  4. On GitHub Actions and GitLab CI, secretless analysis signs in with OpenID Connect and needs no stored token.

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.

Sources, checked 2026-11-16