TypeScript SDK
Official @gogoduk/sdk for TypeScript and JavaScript — install, configure, and call every endpoint from Node, the browser, Bun, Deno, or edge runtimes.
@gogoduk/sdk is the official TypeScript client for the GoGoDuk Map API.
Five typed methods, one consistent error class, ESM + CJS builds, no
runtime dependencies.
- npm: @gogoduk/sdk
- Source: github.com/gogoduk-io/sdk-ts
- License: MIT
Install
Requires Node 18+ for the global fetch. Works in browsers, Bun, Deno,
and Vercel/Cloudflare edge runtimes without a polyfill.
Quick start
Get your API key from the dashboard.
Configuration
Methods
suggest()
Autocomplete predictions. Input must be at least 2 characters.
Pass the same sessionToken across calls in one autocomplete session,
then forward it to placeResolve to close the billing session. See the
suggest endpoint reference.
reverse()
Proximity-based reverse geocode — nearest known address(es) to a point.
See reverse endpoint reference.
placeResolve()
Resolve a placeId from suggest into full place details.
See place/resolve endpoint reference.
reverseGeocode()
Admin-boundary lookup — returns the province and district that contain
the point via PostGIS ST_Contains.
city and district can be null if no boundary contains the point.
See reverse-geocode endpoint reference.
adminBoundaries()
Province and district polygons as GeoJSON or WKT.
Error handling
Every method rejects with GoGoDukError on non-2xx responses or
transport failures:
| Property | Meaning |
|---|---|
status | HTTP status. 0 for network or timeout failures. |
message | Server message / error field, falling back to HTTP <status>. |
requestId | x-request-id header from the response — include when reporting bugs. |
body | Parsed JSON or raw text from the response body. |
Versioning
Pre-1.0 releases (0.x.y) may include breaking changes at minor bumps
(0.1 → 0.2). The full changelog lives at
CHANGELOG.md.
The SDK shape tracks the API. adminBoundaries currently exposes optional
metadata including province_name, population, area_km2,
pre_merge_info, admin_center, and centroid.
Roadmap
- Python SDK (
@gogoduk/sdk-python) once there's demand. Tell us at [email protected] if this would unblock you. - POI search wrapper (
/v1/poisand POI tiles) — deferred until the binary MVT pipeline stabilizes.