Skip to main content

Client SDK

The portal's typed client is @ghasi/sdk-client ? generated from the same OpenAPI files Postman exercises so the docs cannot drift from the implementation.

Install (workspace-internal):

pnpm add @ghasi/sdk-client

Use:

import { catalog, identity, enrollment } from '@ghasi/sdk-client';

const { data } = await catalog.listCourses({
query: { cursor: undefined, size: 50 },
headers: { 'X-Tenant-Id': tenantId },
});

The wrapper auto-injects X-Tenant-Id, generates per-request Idempotency-Key (ULID), propagates traceparent, refreshes JWTs against identity-service (single-use rotation, family revoke on reuse), and honors Retry-After on 429.