@sybilion/platform-sdk
v0.0.5
Published
TypeScript SDK for the Sybilion HTTP API
Readme
@sybilion/platform-sdk
TypeScript client for the Sybilion HTTP API (browser or Node with fetch).
Install
yarn add @sybilion/platform-sdkSetup
import { createSybilionSDK } from "@sybilion/platform-sdk";
const sdk = createSybilionSDK({
/** API origin, no trailing slash. Use `''` for same-origin requests. */
baseUrl: "https://api.example.com",
/** Prepended before paths; default `'/api'`. Final URL: `{baseUrl}{apiPrefix}/v1/...` */
apiPrefix: "/api",
getToken: () => myJwtGetter(),
onUnauthorized: () => myLogout(),
logger: { warn: console.warn, error: console.error }, // optional
});Surfaces
| Surface | Role |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| sdk.auth | Auth0 bootstrap (loginWithAuth0Identity), session user (getMe), profile (updateMe). |
| sdk.raw | Low-level accessors for /v1/... responses as parsed JSON (e.g. raw.analyses.driversMapOnce for a single GET without inner retries). |
| sdk.resources | Composed helpers: datasets, drivers, subscriptions — parsing and convenience on top of raw. |
getDatasetAnalyses and getAnalyses normalize each analysis so name is usable in charts (prefers top-level name, else analysis_cycle.name, else Analysis {id}). Use analysisDisplayName, normalizeAnalysisForDisplay, or toChartForecastItem from the package root when building UI from raw responses.
Helpers executeWithRetry and MAX_RETRY_COUNT are exported from the package root for queue / timeout polling patterns.
License
See repository LICENSE if present.
