@platform/sdk-capri
Typed TypeScript client for services/capri. The page is generated from the SDK package source plus its generated OpenAPI types.
Installation
npm install @platform/sdk-capriYou’ll also need the shared auth/client helpers:
npm install @platform/hosts @platform/sdkQuick start
import { LoopClient } from "@platform/sdk";
import { platformHost, SERVICE_NAMES } from "@platform/hosts";
import { createCapriClient } from "@platform/sdk-capri";
const loop = new LoopClient({
clientId: process.env.LOOP_CLIENT_ID!,
clientSecret: process.env.LOOP_CLIENT_SECRET!,
redirectUri: "https://your-app.example.com/auth/loop/callback",
});
const capri = createCapriClient({
baseUrl: platformHost({ service: SERVICE_NAMES.CAPRI }),
accessToken: tokens.access_token,
});Use the convenience helpers below when the SDK exposes them, or call the typed endpoint methods directly with GET / POST / PATCH / DELETE.
Convenience helpers
This SDK does not add convenience helpers beyond the typed endpoint calls below.
Endpoint calls
GET /readyz
Underlying REST endpoint: GET /readyz
Parameters
None
Return type
Promise<{
data?: paths["/readyz"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await capri.GET("/readyz");POST /v1/sync
Underlying REST endpoint: POST /v1/sync
Parameters
None
Return type
Promise<{
data?: paths["/v1/sync"]["post"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await capri.POST("/v1/sync");GET /v1/sync/{syncId}
Underlying REST endpoint: GET /v1/sync/\{syncId\}
Parameters
path: paths["/v1/sync/{syncId}"]["get"]["parameters"]["path"]
Return type
Promise<{
data?: paths["/v1/sync/{syncId}"]["get"]["responses"]["200"]["content"]["application/json"];
error?: unknown;
response: Response;
}>Example
const result = await capri.GET("/v1/sync/{syncId}", {
params: {
path: {
syncId: "<syncId>",
},
},
});