1. Install the server and React SDKs
Install @norilu/server in your backend and @norilu/react in your frontend. Store your workspace server key (nrl_sk_...) as NORILU_SECRET_KEY on your server—never expose it to the browser.
# Backend + React UI
npm install @norilu/server @norilu/react
The TypeScript SDKs (@norilu/server, @norilu/client, @norilu/react) are published on npm (0.1.x); APIs may evolve before 1.0. Using Python, Go or another language on your backend? Call the REST API directly and keep @norilu/react (or @norilu/client) in your frontend. There is no public Python package yet, and the Go SDK is a private preview available on request. The Python and Go tabs below show the planned SDK shape.
2. Mint a short-lived browser token on your backend
Add one authenticated endpoint to your backend. Derive the customer’s space (their organization ID) and user from your own app session—never trust IDs sent from the browser.
// app/api/norilu-token/route.ts
import { Norilu } from "@norilu/server";
const norilu = new Norilu(); // reads NORILU_SECRET_KEY
export async function POST(req: Request) {
const { orgId, userId, canApprove } = await requireAppSession(req);
const { token } = await norilu.tokens.create({
agent: "agt_billing_01",
space: orgId,
user: userId,
permissions: canApprove
? ["run", "approve", "upload", "feedback"]
: ["run", "upload", "feedback"],
allowedOrigins: ["https://app.example.com"],
ttlSeconds: 300,
});
return Response.json({ token });
}
from norilu import Norilu
norilu = Norilu() # reads NORILU_SECRET_KEY
@app.post("/api/norilu-token")
def create_norilu_token(session = Depends(require_app_session)):
perms = ["run", "approve", "upload", "feedback"] if session.can_approve else ["run", "upload", "feedback"]
result = norilu.tokens.create(
agent_id="agt_billing_01",
space=session.org_id,
user=session.user_id,
permissions=perms,
ttl_seconds=300,
)
return {"token": result.token}
func handleNoriluToken(w http.ResponseWriter, r *http.Request) {
session := requireAppSession(r)
tok, err := client.Tokens.Create(r.Context(), norilu.CreateTokenParams{
AgentID: "agt_billing_01",
Space: session.OrgID,
User: session.UserID,
Permissions: []norilu.TokenPermission{norilu.PermissionRun, norilu.PermissionApprove, norilu.PermissionFeedback},
TTLSeconds: 300,
})
if err != nil {
http.Error(w, "token unavailable", http.StatusBadGateway)
return
}
_ = json.NewEncoder(w).Encode(map[string]string{"token": tok.Token})
}
3. Drop <AgentThread /> into your app
Wrap your component with <NoriluProvider> and render <AgentThread />. Streaming, live tool-call details, inline Approve/Deny cards, file uploads, and scoped artifacts work out of the box.
import { NoriluProvider, AgentThread } from "@norilu/react";
export function SupportCopilot() {
return (
<NoriluProvider
getToken={async () => {
const res = await fetch("/api/norilu-token", { method: "POST" });
const { token } = await res.json();
return token;
}}
>
<AgentThread agentId="agt_billing_01" allowFeedback />
</NoriluProvider>
);
}
4. Connect customer tools & ship tested updates
- Connect each customer’s tools: connect accounts inside the customer’s space or send a single-use, 24-hour Connect Link (no Norilu login required) for supported space connectors so credentials land directly in that space’s isolated Agent Vault. See Connector Vault.
- Turn real failures into v2 releases: when a user flags a bad run, Norilu pins it as a regression test so you can evaluate fixes on unseen cases before calling
norilu.agents.promote(). See Testing & rollouts.
Next, explore the live React component preview or dive into the server SDKs.