1. Journey Funnel Analytics
Tracks clients across the 6 canonical stages (Identified → Assessed → Matched → Booked → Paid → In Treatment). Accurately diagnoses drop-off friction at payment rather than assessment.
Explore Funnel →Consolidate client journey telemetry, detect explainable churn risks, and drive light operational follow-ups across recurring therapy sessions — built on the Padida architecture.
Built specifically to solve patient retention, therapist-client matching friction, and operational visibility.
Tracks clients across the 6 canonical stages (Identified → Assessed → Matched → Booked → Paid → In Treatment). Accurately diagnoses drop-off friction at payment rather than assessment.
Explore Funnel →Analyzes cohort continuation by session number ($N=1$ to $N=10+$). Proves that continuation jumps significantly after Session 3, and detects dangerous inter-session delays before drop-out.
Explore Retention →Rule-based, non-clinical risk classification (risk_v1). Explains exact triggers: unplanned gaps, payment failure, and consecutive cancellations with a 4-outcome resolution flow.
A unified, chronological audit trail for every client: booking intents, session attendance, invoices, and survey responses — with strict role-based access control protecting clinical notes.
Inspect Client 360 →Continuous pipeline observability meeting the Pilot Data Quality Bar: 100% completeness against source records, zero duplicate events, and transparent quarantine isolation.
View Data Health →Full compliance with the Internal Privacy Access Matrix: support staff see zero payment amounts; behavioral events transmit zero patient clinical text; browser events require affirmative consent.
Inspect Governance →The Collector is the sole external write ingress (ADR 0002). Backend services and web clients stream events through lightweight, secure interfaces.
Thin, transport-only Node.js client. Emits authoritative P0 domain facts directly to the Collector. Never connects to the database.
import { createClient } from "@cx-orbit/node";
const cx = createClient({
writeKey: process.env.COLLECTOR_SERVER_WRITE_KEY!,
collectorUrl: "http://127.0.0.1:8080",
environment: "development",
debug: true,
});
// 1. Emit an authoritative payment outcome
cx.paymentSucceeded({
entityId: "pay_987",
sourceEventId: "pay_txn_20260912_01",
userId: "usr_123",
properties: {
orderId: "ord_555",
bookingId: "bkg_777",
packageId: "pkg_individual_4",
amount: 2500000,
currency: "IRR",
gateway: "zarinpal",
},
});
// 2. Emit session completion
cx.sessionCompleted({
entityId: "ses_101",
sourceEventId: "ses_completed_101",
userId: "usr_123",
properties: {
therapistId: "thr_sarah_ahmadi",
sessionNumber: 3,
attendanceStatus: "attended",
actualDurationMinutes: 50,
},
});
// 3. Flush batch to collector (automatic on 20 events or 10s interval)
const result = await cx.flush();
if (result.failed) {
console.error("Ingest warnings/errors:", result.errors);
}Run the 5-step automated collector test suite against your local instance right from your terminal:
./scripts/demo-collector.shAll specifications, architectural decision records, and operational runbooks are versioned in this repository under docs/ and accessible in an interactive documentation viewer.
Step-by-step developer implementation instructions, SDK setup, and automated CLI verification.
Step-by-step instructions for backend engineers to instrument authoritative domain events.
Interactive 5-step test script for collector health, quarantine, batch ingest, and dedup.
Technical architecture of @cx-orbit/node, @cx-orbit/browser, and outbox transports.
Canonical envelopes, source mappings, journey state transitions, and browser consent.
Canonical envelope specification, idempotency key, sent_at vs occurred_at, and 12 P0 events.
Source-to-canonical event mapping matrix and field transformation rules.
6-stage linear conversion spine (Identified → In Treatment) and state machines.
Default-deny consent gate, anonymous ID storage, and browser payload minimization.
Core entities, relational schemas, DDL specifications, and entity classification.
Core entities (client, therapist, session, booking, payment), aliases, and risk snapshots.
Drizzle DDL, transport/canonical dedup tables, and serving materialized views.
Entity field classification: live evented vs periodic ops CSV import.
Ingress boundaries, durable transaction outbox relay, and error troubleshooting runbooks.
Logical layers, collector ingress, identity resolution, operational store, and analytics.
Producer-side durable queueing for zero-loss delivery during network partitions.
Troubleshooting guide for rejects, duplicates, event lag, and recovery.
Collector as the sole write ingress; SDKs never connect directly to storage.
SLO targets, completeness requirements, role-based field masking, and medical privacy.
Launch directly into the staging platform using pre-configured role personas. No setup or manual passwords required.