Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

TypeScript

The TypeScript client uses HTTP/JSON (grpc-gateway). PlatformClient is the typed wrapper shared by the web console.

import { PlatformClient } from '@platform/api-client';
const client = new PlatformClient({
baseUrl: 'http://cloud-api.localhost',
token: process.env.PLATFORM_TOKEN,
});
const instances = await client.listInstances();
const types = await client.listInstanceTypes();

On a local apiserver without compose, use baseUrl: 'http://127.0.0.1:8080'. PLATFORM_REST is the default when baseUrl is omitted (Node). token also falls back to PLATFORM_TOKEN.

The package is @platform/api-client in frontend/packages/api-client. It is a workspace package (not published to npm).

Needs Node 22+. From this repository’s frontend/ workspace:

Terminal window
pnpm add @platform/api-client

npm install @platform/api-client and yarn add @platform/api-client also work inside that workspace.