@wendung/sdk.
InitConfig
The configuration object accepted byWendung.init(). Only apiKey is required; the rest fall back to defaults.
ConsentState
The analytics consent states accepted byinit() and setConsent() and returned by getConsent(). See the consent guide for what each state does.
Config
The full resolved configuration after defaults are applied. Applications normally passInitConfig instead.
Your publishable API key. Sent with every request as the
X-API-Key header; it does not appear in the request body.The resolved ingest endpoint. Defaults to
https://ingest.wendung.app/v1/events. http:// is only permitted for localhost addresses.Maximum events per outbound batch. Defaults to
50; the effective value is clamped to 1–100.Defaults to
false. true enables full pageviews with granted consent. 'auto' also enables aggregate pageviews while pending. Denied consent stops both. See options.Identity
The user context attached to events. Set byWendung.identify(), cleared by Wendung.reset().
The SDK’s random visitor identifier for full analytics. Aggregate pageviews omit identity entirely.
Key-value metadata about the user. Replaced wholesale by each
identify() call.EventContext
Environment metadata captured when an event is tracked.The full URL for consented events, or origin and pathname for aggregate pageviews. Absent outside the browser.
For the first pageview,
document.referrer; for later pageviews, the previous pageview’s URL. Aggregate pageviews restrict it to the origin. Absent when empty or outside the browser.StepEvent
A single tracked event, as queued and as sent in theevents array of a payload. All snapshot fields are captured at the moment Wendung.step() is called.
Deep-cloned copy of the properties passed to
step(). Present only when supplied.Snapshot of the identity at track time. Later
identify() calls do not backfill earlier events.Snapshot of the event context at track time.
EventRequestPayload
The JSON body for full analytics requests.Payload is an alias for this type. Pending aggregate pageviews use AggregatePageviewPayload instead. Requests carry the headers Content-Type: application/json, X-API-Key, and X-Wendung-SDK-Version.
The session ID of the first event in the batch, or the current session if the batch is empty.
ISO 8601 UTC timestamp taken when the payload is serialized, distinct from the per-event
timestamp fields.AggregatePageviewPayload
The request body for pageviews collected withtrackPageviews: 'auto' while consent is pending.
$pageview. The body and its events contain no visitor identity or session ID. Event and batch IDs support delivery deduplication. The pageview field reference describes the restricted context.