Keys / GitLab
GITLAB_TOKEN
A GitLab personal access token your app or script calls the GitLab API with.
- Starts with
glpat-- Expires
- you choose, up to 365 days by default
- API
- list, rotate and revoke; create on GitLab Self-Managed and Dedicated only
Get it
Create one on gitlab.com/-/user_settings/personal_access_tokens. The steps aren't recorded yet.
Set it
GITLAB_TOKEN=glpat-...
The GitLab CLI (glab) reads it; elsewhere, the app passes it in. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Create a new token with the same scopes.
- Deploy it everywhere that reads
GITLAB_TOKEN. - Check that nothing still uses the old token, then revoke it.
- Or select Rotate on the old token: the new one keeps its scopes, but the old one stops working at once.
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.