Web SDK
The client library (TypeScript) that instruments web storefronts and apps, wrapping the shared ingestion contract so every event agrees with the rest of the platform.
High-Level Design
Web SDK is the entry point for every browser-originated event.
💼 Business Context
- Usually the very first integration in any CXOS rollout — the fastest path to real behavioral data
- Auto-captures page views so teams get value before writing a single custom tracking call
- Owned by the Digital / Web Engineering team; changes here affect every page on the site
🔌 Technical Overview
The Web SDK is a thin TypeScript wrapper generated from the same OpenAPI contract published in the Cxos.Ingestion.Client NuGet package, so the browser and the .NET Core Ingestion API never drift on event shape. It auto-instruments page views, assigns and persists an anonymous ID (first-party cookie or localStorage), batches events client-side, and posts them to Azure API Management over HTTPS. A single track() call handles custom events.
Auto-Captured
💾 SDK Initialization
import { Cxos } from '@cxos/web-sdk';
Cxos.init({
writeKey: 'wk_live_9f21ac',
endpoint: 'https://ingest.cxos.example.com',
consentRequired: true,
});
Cxos.track('product_viewed', {
product_id: 'sku-1029',
price: 2499,
});
🔗 Integration Points
- npm package
@cxos/web-sdk, generated from the same contract asCxos.Ingestion.Client - Azure API Management — HTTPS ingress, auth, throttling
- Consent Management Platform hook — gates SDK initialization until consent is granted
- Ingestion API (ASP.NET Core on AKS) — validates and publishes to Azure Event Hubs
🧰 Services Consumed
- Owning microservice —
Cxos.Ingestion.Api(see the Full Application Service Map) - Database — Azure Cache for Redis (cache only)
⚠️ Non-Functional Considerations
- Scale: client-side batching (configurable flush interval/size) reduces request volume during high-traffic pages
- Latency: events are queued in-memory and flushed asynchronously so tracking never blocks page rendering
- Reliability: failed sends are retried with exponential backoff; unsent events persist to localStorage across page reloads
- Security/Privacy: no PII is captured automatically; consentRequired blocks all network calls until the CMP signals consent
🎯 Enterprise Example
A retailer adds three lines of Web SDK initialization to their Angular app's root module. Within a day, page views and product views are flowing into CXOS — before any custom event has been written — giving the analytics team a baseline funnel view immediately.