Node direct
COREDirect Node/server usage of @csl/wrapper-sdk and CslClient for job creation, decision reads, generation reporting, and beacon sending.
This is the best first path for apps that want the released wrapper client surface with the smallest integration footprint.
This is the primary production path documented across the SDK section.
Included today
@csl/wrapper-sdkcreateJob()getDecision()reportGeneration()sendBeacon()
Verified source
README quickstartSDK testsPackage smoke
Use this page when you want the complete server-side lifecycle in one place instead of the shorter quickstart snippet.
The example below stays on the direct CslClient path: initialize once, create the job, report generation, read the decision, send a beacon on fill, and finish the lifecycle.
node-server.ts
typescript
import { CslClient } from "@csl/wrapper-sdk";
const client = new CslClient({
baseUrl: process.env.CSL_BASE_URL ?? "http://127.0.0.1:3000",
getApiKey: () => process.env.CSL_WRAPPER_API_KEY ?? "",
decisionDelivery: "polling",
options: {
wrapper_version: "wavebird-wrapper/2026.03",
},
});
const job = await client.createJob({
job_type: "chat",
model_id: "gpt-4o-mini",
locale: "en-US",
consent: {
semantic_targeting: true,
session_persistence: false,
cross_session_persistence: false,
},
prompt: { text: "I want a travel deal for a weekend trip." },
slots_requested: 1,
});
if (job?.slot_ids[0]) {
await client.reportGeneration(job.job_id, "started", {
generation_id: `gen_${job.job_id}`,
model_id: "gpt-4o-mini",
});
const decision = await client.getDecision(job.slot_ids[0]);
if (decision?.fill === true) {
await client.sendBeacon({
beacon_id: `rendered-${Date.now()}`,
asset_token: decision.asset_token,
beacon_type: "rendered",
occurred_at_ms_client: Date.now(),
});
}
await client.reportGeneration(job.job_id, "finished", {
generation_id: `gen_${job.job_id}`,
model_id: "gpt-4o-mini",
});
}Use Quickstart for the shortest working setup, Integration flow for the step-by-step lifecycle, and CslClient reference for signatures and type-level details.
Ask about integration
Start with Node direct for the recommended production-ready integration path.