E2 for JavaScript and TypeScript
A local-first SDK for Earth feature search, routing, spatial analysis, user-owned data, and space-time cells.
Documentation navigation
Start with E2
SDK guides
CLI guides
MCP guides
Applications
Framework quickstarts
Install
terminal
npm install @embed-earth/sdk-testUse
@embed-earth/sdk-test everywhere. The package selects the browser HTTP backend or the Node local-data backend automatically. Import @embed-earth/sdk-test/node only when you need Node-only helpers such as SQLite, cache management, or uploads. The Node runtime requires Node 20 or newer.Quick start
search.ts
import { E2 } from "@embed-earth/sdk-test";
const e2 = new E2({ cacheDirectory: "./.e2-cache" });
const places = await e2.search({
feature: ["restaurant", "hospital"],
area: ["Manhattan", "Brooklyn"],
mode: "auto", limit: 500,
});
console.log(places.type); // "FeatureCollection"Browser-safe and Node APIs
| Import | Includes |
|---|---|
@embed-earth/sdk-test | E2 with browser HTTP search, routing, catalogs, compute builder, and cell operations. |
@embed-earth/sdk-test/node | Node-only cache, database, upload, download, and snapshot helpers. |
Search and compute use the browser HTTP /search backend or Node snapshots automatically. Pass a local database as compute only for local analysis.
Guides
SearchRemote, offline, and automatic queries.RoutingTyped route and network analysis methods.Local computeFluent spatial analysis over local data.StorageUpload your own GeoJSON, CSV, or Parquet.CellsEncode, parse, traverse, and cover E2 spacetime cells.CatalogsResolve features, regions, and published datasets.
