SDK
Installation
Install lemma-sdk, configure the client, and choose the headless or registry path.
Install the CLI too
If you have not already, install the Lemma CLI (lemma-terminal) to create pods, manage resources, and scaffold apps. See the Getting Started guide for the full setup.
Install the SDK
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.
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
| Runtime | Supported names |
|---|---|
| Vite | VITE_LEMMA_API_URL, VITE_LEMMA_AUTH_URL, VITE_LEMMA_POD_ID |
| CRA / webpack | REACT_APP_LEMMA_API_URL, REACT_APP_LEMMA_AUTH_URL, REACT_APP_LEMMA_POD_ID |
| Node | LEMMA_API_URL, LEMMA_AUTH_URL, LEMMA_POD_ID |
| Browser | window.LEMMA_CONFIG |
Optional registry setup
npx lemma-sdk init-shadcn
npx shadcn@latest add @lemma/lemma-records-view
npx shadcn@latest add @lemma/lemma-assistant-experience