Restricting your Mapbox key to your website
When setting up a Mapbox key, it’s possible to restrict your key to only work with your website. This is optional, but can be a good idea – it ensures that no one else can copy your key from your website and use it on their own site.
Check your existing keys
If you’d like to create a key that only works with your website, you’ll need to create a separate key in the Mapbox dashboard.
Your keys will be listed on this page:
You'll always have a Default public token, and may also have one or more other keys listed there. The number listed after URLs in the key details indicates how many websites have been granted access. A 0 or N/A indicates the key is unrestricted, while a number of 1 or greater indicates that the key will only work on certain sites.
Set up a separate key
On the Access tokens page of the Mapbox dashboard, click Create a token to set up a new key:
Under Token scopes, leave the default option selected. All the checkboxes under Public scopes should be ticked, and all the checkboxes under Private scopes should not be ticked:
Set up URL restrictions
Caution: It's important to only list your base domain (e.g. example.com). Adding the full URL to your page (e.g. example.com/pages/map) won't work.
If you’ve added a full page URL, remove it and add just the base domain instead.
Once your domain(s) have been added, click Create token or Save changes:
Finally, copy your new token from the Mapbox dashboard and paste it into Stockist under "Settings > Map provider":
You must paste the restricted token into Stockist in order for it to be used on your website. If you paste the Default public token into Stockist, this unrestricted token will be used on your website and available for visitors to see.