Mapbox token restriction

Hi, I want to build a map with mapbox in observable. In the restrictions for the mapbox token I allowed https://observablehq.com/ but the base map is not displayed. What have I done wrong?

This is my notebook:

1 Like

Your notebook runs in a sandboxed iframe under a different domain. You can see the domain that you need to allow by creating a cell with the following content:

// Outputs "rnd.static.observableusercontent.com"
document.location.host
1 Like

It might also be worth mentioning that, if you ever plan to embed your map in another site via the Javascript runtime, then location.host will reflect that site. In that case, you might want your mapbox token to reflect multiple domains.

1 Like

Thanks, the domain I get from that cell is rnd.static.observableusercontent.com

I allowed this domain and additionally https://rnd.static.observableusercontent.com/

but the bas map still does not appear. Do you have an idea why?

Most likely no referer is sent when requesting the tiles.