Keys / Mapbox
MAPBOX_ACCESS_TOKEN
The token your app calls Mapbox APIs with: a public pk. token for maps in the browser, a secret sk. token on a server, or a temporary tk. token.
- Expires
- never; temporary tk. tokens last up to 1 hour
- API
- create, list, update and delete, with a
tokens:writesecret token
Get it
Create one on console.mapbox.com/account/access-tokens. The steps aren't recorded yet.
Set it
MAPBOX_ACCESS_TOKEN=...
The Mapbox Tilesets CLI and the Mapbox MCP server read it from this variable. Other apps pass the token in. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- On the Access tokens page, create a new token with the same scopes and URL restrictions.
- Deploy it everywhere that reads
MAPBOX_ACCESS_TOKEN. Both tokens work in the meantime. - Check that nothing still uses the old token, then delete it. Requests stop at once, except responses already cached, which vary by service.
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.