Files
api/readme.md
T

737 B

@serve.zone/api

Type-safe API client for Cloudly and the serve.zone control plane.

Install

pnpm add @serve.zone/api

Usage

import { CloudlyApiClient } from '@serve.zone/api';

const client = new CloudlyApiClient({
  registerAs: 'api',
  cloudlyUrl: 'https://cloudly.example.com:443',
});

await client.start();

const identity = await client.getIdentityByToken('service-token', {
  tagConnection: true,
  statefullIdentity: true,
});

const clusterConfig = await client.getClusterConfigFromCloudlyByIdentity(identity);

Notes

  • The client uses TypedSocket for WebSocket RPC and TypedRequest for HTTP fallback in selected methods.
  • Shared contracts are provided by @serve.zone/interfaces.