TypeScript client for the Sentio API. The bindings are generated from Sentio's protobuf definitions with protobuf-es and call the REST API through connect-es with the @sentio/connect-gateway-es transport — fully typed requests and responses, including server-streaming endpoints.
v2 is a breaking rewrite. v1 (
openapi-tsbased:client.setConfig+ static service classes) is replaced by connect-es style clients. The REST API itself is unchanged; see the examples below for the new shapes. The package is ESM-only and requires Node 24+.
pnpm add @sentio/api
Create an API key under your project's settings on app.sentio.xyz.
import { createSentioClient, WebService } from "@sentio/api";
const web = createSentioClient(WebService, {
apiKey: process.env.SENTIO_API_KEY,
});
const dashboards = await web.listDashboards({
ownerName: "sentio",
slug: "coinbase",
});
console.log(dashboards);import { createSentioClient, InsightsService } from "@sentio/api";
const insights = createSentioClient(InsightsService, {
apiKey: process.env.SENTIO_API_KEY,
});
const res = await insights.query({
projectOwner: "sentio",
projectSlug: "coinbase",
timeRange: {
start: "now-30d",
end: "now",
step: 3600,
timezone: "America/Los_Angeles",
},
limit: 20,
queries: [
{
metricsQuery: {
query: "cbETH_price",
},
},
],
});
console.log(res);Request messages are plain partial objects (protobuf-es init shapes) — omitted fields take their proto defaults.
import { createClient, createSentioTransport, AnalyticService, WebService } from "@sentio/api";
const transport = createSentioTransport({ apiKey: process.env.SENTIO_API_KEY });
const web = createClient(WebService, transport);
const analytics = createClient(AnalyticService, transport);Each service module exports its request/response types; deep-import them via
the gen subpath:
import type { Project } from "@sentio/api/gen/service/common/protos/common_pb.js";createSentioClient / createSentioTransport accept:
apiKey— sent as theapi-keyheader.baseUrl— defaults tohttps://app.sentio.xyz.- everything else from
GatewayTransportOptions(headers,fetch,interceptors,defaultTimeoutMs, ...).
Errors are connect-es ConnectErrors carrying the mapped gRPC code and the
server's google.rpc.Status details.
The raw REST API is documented at docs.sentio.xyz; this repository also ships the OpenAPI spec and a generated HTML reference. Both reflect the same API surface as the TypeScript client.