Client SDK
Typed Client
Full TypeScript autocomplete and type checking
Typed Client#
Create a typed proxy for full TypeScript autocomplete and type checking:
typescript
// Define your command typesinterface MyCommands { search: { params: { query: string; limit?: number } result: { results: Product[]; total: number } } 'cart.add': { params: { sku: string; quantity?: number } result: { added: string } }}ย // Create typed clientconst typed = client.typed<MyCommands>()ย // Full autocomplete and type safetyconst { results, total } = await typed.search({ query: 'laptop' })// ^ Product[] ^ number