Beta. STARCO Dev works with synthetic data only: do not send real personal or health data. Every feature shows its real status (Available Beta Beta · in development Coming).

Documentation menu

Reference Beta · in development

SDKs and the command line.

Two SDKs and a command line over the same API: Python, TypeScript and starco. They add nothing the HTTP API does not have: they save you the plumbing, check hashes for you and turn refusals into typed errors.

reading time about 3 min

Not published in any package registry yetThe SDKs and the command line are written and are run end to end against the API on every change, but they are not on PyPI or npm: there is no pip install or npm install command that works today, and this page does not give one. Until they are distributed, every guide on this site also shows plain HTTP with curl, which needs nothing installed. If you have an account, ask us for the source of the SDKs.

What there is#

PieceRuns onDependenciesStatus
Python SDK (starco)Python 3.8 or laterNone: standard library onlyBeta · in development
TypeScript and JavaScript SDK (@starco/sdk)Node 18 or later, browsers, Deno (ES modules, global fetch and Web Crypto)NoneBeta · in development
Command line (starco)Python 3.8 or laterThe Python SDKBeta · in development

The type definitions of the TypeScript SDK are written by hand. They are compiled with the TypeScript compiler in strict mode against a program that uses every resource, together with a list of misuses the types must refuse, and a test compares them with what the SDK exports and does at run time. The SDK itself is tested as JavaScript.

The same task, four ways#

Read the current value of a measure, set it only if nobody changed it meanwhile, and read a week of a series by day. Choose a language once: every code block of this site follows your choice.

V=$(curl -s "$API/twins/$TWIN/state/wellness.mood_level" -H "Authorization: Bearer $STARCO_KEY" | jq -r .version)
curl -s -X PUT "$API/twins/$TWIN/state/wellness.mood_level" -H "Authorization: Bearer $STARCO_KEY" \
  -H "Content-Type: application/json" -H "If-Match: \"$V\"" -d '{"value": 4}'
curl -s "$API/twins/$TWIN/series/wellness.sleep_hours?bucket=1d&agg=avg" -H "Authorization: Bearer $STARCO_KEY"

What they do for you#

typed errors
A refusal becomes an exception that carries the API's code: a 409 on a version is a version-conflict error with current_version; the command line prints (error) <code>: … and exits 1. The codes are the ones of errors by code.
verified exports
Exporting a twin checks that the SHA-256 of the bytes received equals X-Content-SHA256, and fails if it does not.
the audit chain, recomputed
One call reads the whole chain of the project and recomputes every hash on your machine, with no secret.
webhook signatures
A helper verifies X-Starco-Signature (t=<unix time>,v1=<hex>) with a tolerance for the timestamp, in constant time.
no revalidation
The SDKs do not second-guess the server: buckets, aggregations, types and URLs are validated there, and the refusal reaches you with its code.
no surprises with null
A measure without a value is None, null or (nil). Never zero.

How they are tested#

The SDKs and the command line are run against a real server of the API, not a stand-in for it: state with versions and conflicts, transactions, series with gaps, events, webhook signatures, the read-only MCP and the audit chain. The code blocks of the guides of this site are extracted from the published pages and executed the same way, so what you read is what ran.

Next#