@goway.to/sdk

中文文档
0.7.1发布于 2026/10/25SEE LICENSE IN LICENSETypeScriptESM + CJS构建来源已验证近 30 天下载 6125

The canonical, headless TypeScript client for GoWay's public geographic API — Places, capability filters, search, geocoding, routing, typed errors and canonical links for Node, Bun, browsers and React Native.

原始使用文档
文档目录5 节
  1. Install
  2. Quick start
  3. Entry points
  4. Documentation
  5. License

@goway.to/sdk

The TypeScript client for GoWay's public geographic API: GoWay places and capability filters, search, geocoding, routing, live vehicles, road rules, and canonical GoWay links and map style URLs. Every request is validated before it is sent, every response is parsed against the API's own contract, and every failure is a typed error. It runs in Node 18+, Bun, browsers and React Native, and depends only on zod.

Install

npm install @goway.to/sdk

Quick start

import { createGoWayClient, placeDisplayName } from '@goway.to/sdk';

const goway = createGoWayClient({ locale: 'en' });

const nearby = await goway.places.nearby({
  latitude: 41.3874,
  longitude: 2.1686,
  radiusMeters: 1000,
  capabilities: ['payments.faircoin.accepted'],
});

for (const place of nearby.items) {
  console.log(placeDisplayName(place), Math.round(place.distanceMeters), 'm', goway.links.place(place));
}

Search, browsing and routing need no account. Oxy applications use the session's shared transport, which refreshes and fences account changes automatically:

const linked = oxyServices.createLinkedClient({ baseURL: apiBaseUrl });
const goway = createGoWayClient({ apiBaseUrl, fetch: linked.fetchOptional });
// Dispose the linked client when its owning application context is released.

The generic getAccessToken option remains available for external integrations that own their token lifecycle. Own applications do not copy a session token.

Entry points

ImportContents
@goway.to/sdkThe HTTP client (createGoWayClient), typed errors, pagination, contract types and helpers.
@goway.to/sdk/liveThe GoWay Live Socket.IO protocol: events, room tiles, message parsers. Bring your own socket.io-client.
@goway.to/sdk/geoWeb Mercator, boxes across the antimeridian, distances, pixel projection.
@goway.to/sdk/road-accessWho may use a road, from OpenStreetMap access tags.
@goway.to/sdk/mapMap style names and documents, the style catalogue, the tile schema, localized labels. No zod.

Documentation

License

SEE LICENSE IN LICENSE: the terms are in the LICENSE file shipped with this package.

版本与发布记录

@goway.to/sdk 共发布 7 个版本,首次发布于 2026/09/20;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.7.1latest2026/10/2522 天前
0.7.02026/10/1730 天前
0.6.02026/10/1730 天前
0.5.02026/10/171 个月前
0.4.0confirmed-ecosystem2026/10/151 个月前
0.3.02026/10/051 个月前

关于 @goway.to/sdk 的常见问题

@goway.to/sdk 是什么?

The canonical, headless TypeScript client for GoWay's public geographic API — Places, capability filters, search, geocoding, routing, typed errors and canonical links for Node, Bun, browsers and React Native.

如何安装 @goway.to/sdk?

在项目目录运行 npm install @goway.to/sdk,或使用 pnpm add / yarn add / bun add。

@goway.to/sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@goway.to/sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@goway.to/sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@goway.to/sdk 可以商用吗?

@goway.to/sdk 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@goway.to/sdk 的下载量有多少?

根据 npm 官方下载统计,@goway.to/sdk 在 2026/10/17 – 2026/11/15 这 30 天内被下载 6,125 次,日均约 204 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@goway.to/sdk 还在维护吗?

最新版本 0.7.1 发布于 2026/10/25(22 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/09/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。