Hello there!
I was wondering, does anyone know whether it is possible to add the Mapbox key via an environment variable (via MAPBOX_KEY
or something like that)? The docs kinda suggest it is possible but there is no reference (either in code and configuration docs) to found for it.
The hint I am seeing for this, is on this page: Interfaces | Directus Docs
Maps Provider
By default, Directus will use OpenStreetMap to display your mapping data.By entering a Mapbox API key, you can enhance the platform’s mapping experience.
There is a text that has a link to the (old) docs website.
Thanks!
Yeah, you’re absolutely right - there’s currently no way to set the Mapbox key via environment variables.
The Mapbox API key needs to be configured through the Project Settings in the Directus admin interface, not through environment variables.
That broken documentation link is definitely confusing and misleading. The hint in the docs makes it sound like you can use env vars, but that’s not actually supported right now.
- Go to Settings > Project Settings in your Directus admin
- Look for the Mapbox Access Token field
- Enter your API key there
If you need this to be configurable via environment variables for your deployment workflow, you might want to submit a feature request on the Directus GitHub repository.
Thanks for pointing out that broken link - we should definitely get that documentation updated to avoid confusion.
Thanks for this reply @bryantgillespie !
I was mainly just wondering about it. I don’t need to have it configured via env variables. So if someone does want that, feel free to create an issue like Bryant is mentioning
.