Skip to content

createClient

function createClient<TSchema>(options): Client<TSchema>;

Defined in: client/src/client/client.ts:24

Create a typed client for a schema-described server. The TSchema type parameter is the ApiSchema interface produced by generateClientTypes; it is a pure compile-time contract — nothing about it exists at runtime, so the client is a thin set of proxies that build request URLs from the property path being accessed.

Type Parameter
TSchema
Parameter Type
options ClientOptions

Client<TSchema>

import type { ApiSchema } from './client.generated.js';
const client = createClient<ApiSchema>({ baseUrl: 'http://localhost:3800' });
const note = await client.providers.notes.entities.note.get('note_8f2a');