Concepts

This page explains the core concepts behind the wavebird SDK. Read this before diving into the API reference. Each concept maps directly to a method or type in the SDK. For the broader system architecture, see What is the CSL?.

Quick answer

Think of the SDK as one app-facing flow: create a Job, let the Generation and sponsor Slots run in parallel, receive a Decision, and send Beacons so the proof trail stays complete.

When does the ad appear?

Your application code controls when createJob() runs relative to your model call. The SDK does not enforce timing, but it now exposes resolveAdTimingPlan() so wrappers can use one official, typed mapping for before, while, and after inference orchestration.

Canonical helper: resolveAdTimingPlan("while") maps to request_phase: "during_inference", render_phase: "during_inference", and keep_mounted_after_inference: false.

Before inference

Call createJob() first, show the ad, then start the model call.

During inference

Start createJob() and the model call in parallel. This is the recommended path because the ad can arrive while the model is thinking.

After inference

Wait for the model response, then call createJob() and show the ad afterwards.

On this page

Job

A Job is the central unit of a GenAI interaction in wavebird. When your app opens a sponsoring slot, it creates a Job through createJob(). The Job brackets everything together: the AI request, the sponsor slots, and the proof trail.

  • SDK method: createJob()
  • Returns: job_id, slot_ids, status
  • Lifecycle: created -> completed / failed / aborted
  • A Job has exactly one Generation and 0..n Sponsor Slots.

A note on context: You can start with only job_type and let the SDK default the rest. When you want matching context without sharing prompt text, send context.topic. If you choose to send prompt, the prompt text you pass to createJob() is sent to the CSL, not to the configured ad path. The CSL's data firewall extracts only an abstract topic category and the language. Raw prompt text never reaches SSPs, DSPs, or advertisers.

Generation

A Generation is the AI model request within a Job. While the Generation runs, the ad auction runs in parallel. The app reports the Generation lifecycle through reportGeneration().

  • SDK method: reportGeneration(jobId, event, request-)
  • Events: started, finished, failed
  • Key behavior: if a Generation fails, open Slots are cleaned up so the app does not carry orphaned ad placements after a model error.

Sponsor Slot

Slot

A Slot is a single ad placement within a Job. While the model works, a sponsoring window opens: the Slot. Into this Slot, a Decision is loaded.

  • SDK method: getDecision(slotId)
  • Currently supported formats include banner and video clip, configured in your app config. The architecture is format-agnostic.
  • No-Fill: if no ad meets your rules, nothing is shown and the model response is delivered normally.
  • The Slot connects a compute process to an advertising opportunity. That is the core idea behind Compute Sponsoring.

The Slot connects a compute process to an advertising opportunity. That is the core idea of Compute Sponsoring.

Decision

A Decision is the configured ad path's answer to a Slot: Fill if an ad is available, or No-Fill if there is no match under the current rules.

  • SDK method: getDecision(slotId) returning a DecisionResponse
  • Fill contains: creative, asset_token, constraints, cs_declaration
  • No-Fill contains: no_fill_reason, reason, cs_declaration
  • Delivery modes: polling, websocket, callback
  • The cs_declaration states which Compute Sponsoring privacy profile is active, for example CS-S (S1/P0).

The active cs_declaration points back to the privacy profile described in Consent and CS.

Beacon

A Beacon is a measurement event the app sends after an ad has been rendered. Beacons turn delivery into verifiable display evidence and extend the proof trail for the impression.

  • SDK method: sendBeacon(request)
  • Types: rendered, visible_started, visible_ended, heartbeat, play_started, play_completed, clicked
  • Each beacon contains: beacon_id, asset_token, occurred_at_ms_client
  • Billing requires the full creative-specific sequence, not just rendered.

For the proof perspective behind beacons, see What is the CSI?. Banner placements become billable after visible_ended; clip placements become billable after play_completed.

Proof Pack

A Proof Pack is a signed evidence package for independent invoice verification. Instead of self-reported numbers, wavebird produces auditable proof for each billing period.

  • Proof Packs let advertisers verify an invoice independently.
  • Billing remains deterministic: the same events under the same rules lead to the same outcome.

For the proof architecture behind this, see What is the CSI?.

API first, Script Tag second, SDK third

Back to API docsContact the team

These pages are the advanced package layer for teams that intentionally choose @csl/wrapper-sdk. Primary onboarding still lives in the API docs, and browser-first installs should start with the Script Tag. Use contact only when you want rollout review, enterprise coordination, or help with non-standard integration constraints. Beacon billing rules live in SDK Concepts.