mirror of
https://github.com/mapbox/mapbox-gl-draw.git
synced 2025-12-08 18:01:54 +00:00
* Switch to ESM * Switch to NPM instead of Yarn * Switch to the native Node test runner * Drop the `buble` compiler * Drop `xtend`, use `Object.assign` instead * Drop `lodash.isequal`, use `fast-deep-equal` instead
11 lines
317 B
JavaScript
11 lines
317 B
JavaScript
export function getAccessToken() {
|
|
const accessToken =
|
|
process.env.MapboxAccessToken ||
|
|
process.env.MAPBOX_ACCESS_TOKEN ||
|
|
(new URLSearchParams(location.search).get('access_token')) ||
|
|
localStorage.getItem('accessToken');
|
|
|
|
localStorage.setItem('accessToken', accessToken);
|
|
return accessToken;
|
|
}
|