Open chriszrc opened 4 years ago
Hmm I use this library all the time in the browser and have never needed to touch browser-client I just follow per the usage
const mbxClient = require('@mapbox/mapbox-sdk');
const mbxStyles = require('@mapbox/mapbox-sdk/services/styles');
const mbxTilesets = require('@mapbox/mapbox-sdk/services/tilesets');
const baseClient = mbxClient({ accessToken: MY_ACCESS_TOKEN });
const stylesService = mbxStyles(baseClient);
const tilesetsService = mbxTilesets(baseClient);
Is this wrong? I thought that this library worked out internally if it was in the browser on in node.
And then, once you figure that out, typescript complains about the browser-client import because there are no typings for that module :(
Sorry I don't use typescript so can't help there but see #213 for context, I presume you can use externally maintained typescript definitions?
Also some typescript work happening at #361, but again I don't use typescript so out of my depth here.
The usage docs here:
https://github.com/mapbox/mapbox-sdk-js#usage
Don't mention anything about needing to pass in the "BrowserClient" when using services from a web app, e.g. :
And then, once you figure that out, typescript complains about the browser-client import because there are no typings for that module :(