Browse docsMenu

SDK

Installation

Install lemma-sdk, configure the client, and choose the headless or registry path.

Install the SDK

bashcopy
npm install lemma-sdk

Create a client

The SDK resolves API/auth URLs from explicit overrides, window config, or environment variables. Defaults point at the hosted Lemma services.

tscopy
import { LemmaClient } from "lemma-sdk";

const client = new LemmaClient({
  apiUrl: import.meta.env.VITE_LEMMA_API_URL,
  authUrl: import.meta.env.VITE_LEMMA_AUTH_URL,
  podId: import.meta.env.VITE_LEMMA_POD_ID,
});

await client.initialize();

Environment names

RuntimeSupported names
ViteVITE_LEMMA_API_URL, VITE_LEMMA_AUTH_URL, VITE_LEMMA_POD_ID
CRA / webpackREACT_APP_LEMMA_API_URL, REACT_APP_LEMMA_AUTH_URL, REACT_APP_LEMMA_POD_ID
NodeLEMMA_API_URL, LEMMA_AUTH_URL, LEMMA_POD_ID
Browserwindow.__LEMMA_CONFIG__

Optional registry setup

bashcopy
npx lemma-sdk init-shadcn
npx shadcn@latest add @lemma/lemma-records-view
npx shadcn@latest add @lemma/lemma-assistant-experience