package
Parse a Mapbox API token, in Node or the browser
npm install @mapbox/parse-mapbox-tokenGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
20.0 kB
Includes dependencies.
Parse a Mapbox API token, in any JS environment, including Node, browser, and React Native.
Learn about Mapbox API tokens by reading Mapbox's API documentation.
npm install @mapbox/parse-mapbox-tokenvar parseToken = require('@mapbox/parse-mapbox-token');
var parsed = parseToken('MY_MAPBOX_TOKEN');
var ownerId = parsed.user;Returns an object representing the parsed token. Properties vary depending on the type of token (public, secret, or temporary).
The following properties will always be present:
pk, sk, or tk (public, secret, or temporary).The following properties may or may not be present:
The token's payload is parsed with base-64.
Registry package owners.
yannick.meeus+npm+prod+08@mapbox.com