JavaScript SDK quickstart
Install @topolab/sdk for Node or the browser, page through OGC feature collections, and download datasets — with the GA fetch equivalent you can use today.
Requires: Node 18+ (or a modern browser) and an API key. Paging OGC items is a Team / Enterprise plan capability; downloads need an active license for the dataset. The SDK is in preview; the REST and OGC APIs it wraps are generally available.
Install and create a client
Install @topolab/sdk (ships ES modules and TypeScript types, uses the platform fetch) and construct a Client with your key. Load the key from the environment rather than embedding it in client-side bundles.
npm install @topolab/sdk
import { Client } from "@topolab/sdk";
const tl = new Client({ apiKey: process.env.TOPOLAB_API_KEY });
Page through items
.items() queries the OGC API - Features endpoint for a collection and returns GeoJSON features. Pass limit to page and bbox (WGS84, [minLon, minLat, maxLon, maxLat]) to filter to an area. OGC access is a Team / Enterprise plan capability. The OGC collectionId is the dataset's table name.
const fc = await tl.dataset("nl-domino-poi").items({
limit: 100,
bbox: [4.7, 52.2, 5.1, 52.5],
});
console.log(fc.features.length);
GA equivalent while the SDK is in previewCall the OGC items endpoint directly with fetch and your X-API-Key header — the response is a standard GeoJSON FeatureCollection; follow the next link in fc.links to page. Keep downloads server-side: a key embedded in browser code is exposed to every visitor.
Laatst bijgewerkt 25 juli 2026