ALL SYSTEMS · 99.97%
UTC --:--:--
Docs·SDKs·TypeScript

TypeScript SDK · @goable-io/sdk

A thin, fully-typed transport over the public API — one request method powers every call, and the types are generated from the OpenAPI contract.

Install

npm install @goable-io/sdk
# pnpm add @goable-io/sdk · yarn add @goable-io/sdk

ESM, Node ≥ 18 (uses global fetch; inject your own on older runtimes). Zero runtime deps.

Quickstart

import { GoableClient } from "@goable-io/sdk"

const goable = new GoableClient({ apiKey: process.env.GOABLE_API_KEY! })

const { score, verdict, breakdown } = await goable.score({
 location: { lat: 36.013, lng: -5.604 },
 activity: "kitesurfing",
 window: { from: "2026-05-23T09:00Z", to: "2026-05-23T18:00Z" },
})

Authentication

The constructor takes your key plus optional transport overrides. See Authentication for how keys work.

new GoableClient({
 apiKey: string, // required
 baseUrl?: string, // default https://api.goable.io
 fetch?: FetchLike, // inject for tests
 timeoutMs?: number, // default 30000; 0 disables
})

Methods

MethodEndpoint
score(req)POST /v1/score
scoreSeries(req)POST /v1/score/series
scoreMulti(req)POST /v1/score/multi
scorePortfolio(req)POST /v1/score/portfolio
scoreHistorical(req)POST /v1/score/historical
projections(req)POST /v1/projections
decision(req)POST /v1/decision
health()GET /v1/health

Try it

Pick an activity, a spot and the flags. Runs against the live engine (public demo tenant, 60 calls / hour / IP); falls back to a deterministic sample.

Try it · liveready
request
activity
spot
breakdown
language
expected response
{
"score": 76,
"verdict": "favorable",
"confidence": 0.75,
"breakdown": {
"wind": {
"contribution": 0.323,
"score": 77
},
"wave": {
"contribution": 0.137,
"score": 76
},
"tide": {
"contribution": 0.085,
"score": 85
},
"thermal_breeze": {
"contribution": 0.094,
"score": 78
}
},
"physics": {
"wind": {
"value": 28,
"unit": "knots"
},
"wave": {
"value": 2.4,
"unit": "meters"
},
"period": {
"value": 6.8,
"unit": "seconds"
},
"tide": {
"phase": "falling"
}
},
"alerts": [],
"provider_chain": [
"stormglass",
"openmeteo-marine",
"noaa"
],
"computed_at": "2026-05-23T09:00:00.000Z"
}

Errors

Non-2xx throws GoableApiError (with status, code, issues); transport failures throw GoableNetworkError. See Errors & rate limits.

import { GoableApiError } from "@goable-io/sdk"

try { await goable.score(req) } catch (err) {
 if (err instanceof GoableApiError)
 console.error(err.status, err.code)
}

Types

ScoreRequest, ScoreResponse and the rest are generated from the server's OpenAPI 3.1 spec — an API change flows into the SDK types without hand-editing. Full endpoint reference: POST /v1/score.