mapbox / mapbox/mapbox-sdk-js

Missing documentation and types for BrowserClient

Open
#367 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
768
Forks
191
PR merge metrics
No merged PRs in 30d

Description

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. :

```
import mbxClient from "@mapbox/mapbox-sdk/lib/browser/browser-client";
import mbxGeocoding from "@mapbox/mapbox-sdk/services/geocoding";

const baseClient = mbxClient({
accessToken: process.env.REACT_APP_MAPBOX_ACCESS_TOKEN,
});
const geocodingService = mbxGeocoding(baseClient);
```

And then, once you figure that out, typescript complains about the browser-client import because there are no typings for that module :(

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the usage documentation at the linked repository URL and the browser-client module imported as @mapbox/mapbox-sdk/lib/browser/browser-client. Document the BrowserClient setup required for browser services and add TypeScript typings for that import. Done means the browser usage is explained and the import no longer produces a missing-typings error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.