Skip to content

Quickstart

Install

Terminal window
pnpm add @autogen-labs/api-client-kit

In the core monorepo this resolves via workspace:*. Satellite apps (web-public, app-dashboard) use a local Hono contract + hono/client until the kit is published.

Typed RPC (preferred)

import { createCoreApiClient, unwrapData } from "@autogen-labs/api-client-kit";
const api = createCoreApiClient(process.env.NEXT_PUBLIC_CORE_API_URL!, {
headers: () => ({ Authorization: `Bearer ${token}` }),
});
const res = await api.v1.me.$get();
const me = await unwrapData(res);

Path helper

import { createApiClient } from "@autogen-labs/api-client-kit";
const api = createApiClient("https://api.example.com", { token: process.env.API_KEY });
const me = await api.get("/v1/me");

Next: see Authentication.