Libraries
    Preparing search index...

    Type Alias UnifiedClient<T>

    UnifiedClient: { [G in keyof T]: UnifiedGroup<T[G]> }

    Maps an API contract to a unified client where every endpoint is both a callable function (direct HTTP fetch) and an object with TanStack Query hooks.

    Type Parameters

    • T extends ApiContract

      The exact API contract type from defineApi().

    const client = createClient(api, { baseUrl: '/api' });

    // Direct fetch
    const todos = await client.todos.list();

    // React hooks
    const { data } = client.todos.list.useQuery();