Installation
Install the SDK, get an API key, and start authorizing agent actions — no Docker, no server setup.
Install the SDK
Add lelu-agent-auth to your project:
npm install lelu-agent-auth
Supports Node.js 18+. TypeScript types are included — no separate @types package needed.
Get an API key
Visit lelu-ai.com/api-key and click Generate Key. No signup, no email — instant anonymous key with 500 requests/day free.
Add it to your .env file:
LELU_API_KEY=your_key_here
Never commit your API key to version control. Add .env to .gitignore.
Configure the client
Create a shared client instance and import it wherever you need to authorize actions:
import { createClient } from "lelu-agent-auth";
export const lelu = createClient({
apiKey: process.env.LELU_API_KEY,
});That's all the configuration needed. The SDK routes to the live cloud engine automatically when an API key is present.
Then use it anywhere in your app:
import { lelu } from "@/lib/lelu";
const decision = await lelu.agentAuthorize({
actor: "billing-agent",
action: "refund:process",
resource: { orderId: "ord_123" },
context: { confidence: 0.85 },
});
if (decision.allowed) {
// proceed
} else if (decision.requiresHumanReview) {
// queued for human approval
} else {
throw new Error(`Denied: ${decision.reason}`);
}Done
Your agent is connected to the Lelu cloud engine. No Docker, no local server, no infrastructure to manage.
Where to go next:
Self-hosting (advanced)
If you need to run the engine on your own infrastructure, pass a baseUrl to the client or set the LELU_BASE_URL environment variable:
const lelu = createClient({
baseUrl: "https://your-engine.example.com",
apiKey: process.env.LELU_API_KEY,
});Or without any code change:
LELU_BASE_URL=https://your-engine.example.com LELU_API_KEY=your_key_here
To run the engine locally with Docker:
git clone https://github.com/lelu-auth/lelu.git cd lelu docker-compose up -d
See the production self-hosting guide for Docker Compose and Kubernetes manifests.
How URL resolution works
The SDK picks the engine URL automatically:
| Situation | Engine used |
|---|---|
| apiKey provided, no baseUrl | Lelu cloud (GCP) |
| LELU_BASE_URL env var set | That URL |
| baseUrl passed to createClient | That URL |
| No apiKey, no env var, no baseUrl | http://localhost:8080 (self-hosted dev) |