Register a Mapbox API access token

Edited

The Expanse, Fetch and Gem themes use a more performant Maps section that leverages Mapbox to render your location details. For the map to display, you'll need to register a Mapbox API access token and include it in the Maps section settings in the theme editor.

Register the access token

Steps

  1. Visit the Mapbox access tokens page.

  2. Click Create a token.

  3. Enter a name for the access token's Name.

  4. Ensure the default Public scopes are enabled.

  5. Restrict API access to only your store (recommended).

  6. Click Create token.

Add your Mapbox API access token to your theme

Steps

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme that you want to edit, and then click Customize.

  3. Click Add section.

  4. Click Map, and then click Select.

  5. Enter the information for your map. In the Mapbox API access token field, paste your Mapbox API access token.

  6. Click Save.

Restrict API access to only your store

Mapbox allows you to restrict access to your API. Your API access token is a unique identifier for your map that prevents others from using your API key by restricting its access to only your domains.

Steps

  1. Go to the Mapbox access token page.

  2. Choose the API access token that you generated to begin editing.

  3. Under URLs, enter any domain associated with your store, including your ***.myshopify.com domain. For example, if you have a custom domain, then enter both https://myCustomDomain.com and https://shop1.myshopify.com.

  4. Click Save.