Skip to navigation

Client SDKs

Generated REST clients for the Cargovision API.
View as Markdown

The cargovision-sdk repository contains clients generated from the same OpenAPI specification as the API reference. The SDKs cover the REST API only; live video is a direct WebSocket connection from the edge device to the dashboard.

The packages are not published to public registries yet. Install them from a checkout of the cargovision-sdk repository.

Languages

TypeScript, Python, Go, Rust, Ruby, Java, Kotlin, Scala, C#, Swift, Dart, PHP, Perl, Elixir, Haskell, C, C++, Zig, and Shell. The TypeScript client also has a convenience wrapper, @cargovision/sdk-wrapper, that creates every API group from one configuration.

Generated method names come from the HTTP method, the endpoint’s tag, and its path. For example, GET /v1/containers is getContainersV1Containers in TypeScript and get_containers_v1_containers in Python.

Examples

// npm install /path/to/cargovision-sdk/wrappers/typescript
import { createCargoVisionClient } from "@cargovision/sdk-wrapper";
const client = createCargoVisionClient({
baseUrl: "https://api.cargovision.app",
accessToken: process.env.CARGOVISION_JWT,
});
const containers = await client.containers.getContainersV1Containers({
page: 1,
limit: 20,
});

Choosing credentials

CallerConfigure
People and dashboard-like appsA JWT as the bearer access token (accessToken, access_token)
Trusted edge devicesThe edge API key (apiKey, or api_key={"apiKeyAuth": ...} in Python)

Never configure the edge API key in browser or mobile code. See Authentication.