EdgeStream is a 14-package TypeScript monorepo organised in a strict layered architecture. Each message travels through a deterministic pipeline — validated, normalised, filtered, logged, and delivered with a complete audit trail.
Packages are organised in three layers. Each layer may only depend on packages in layers below it — no upward dependencies, no circular imports.
Every message passes through a deterministic hook pipeline before reaching subscribers. Hooks are ordered by priority, composable, and independently testable.
| Hook | Priority | Purpose |
|---|---|---|
| pre-pipeline | 0 | Early interceptors, rate limiting |
| validation | 10 | Schema validation, envelope structure check |
| normalization | 20 | Convert to IEnvelope + CloudEvents format |
| filter | 30 | Drop messages not matching subscription patterns, security checks |
| log (incoming) | 40 | Record arrival, source, metadata, processing start time |
| enrichment | 50 | Add business context, user data, entity information |
| routing | 60 | Resolve destination subscribers via topic matching |
| custom hooks | 70+ | User-defined transformation, third-party integrations |
| post-pipeline | 100 | Final processing before pub/sub delivery |
| Hook | Priority | Purpose |
|---|---|---|
| pre-pipeline | 0 | Early interceptors, outgoing validation |
| transformation | 10 | Convert app format → transport format, add timestamp and routing metadata |
| log (outgoing) | 20 | Record send, destination, metadata for audit trail |
| retry | 30 | Queue failed messages with exponential backoff |
| custom hooks | 40+ | Post-send processing, webhook triggers, notifications |
IEnvelope is the canonical message format. It is CloudEvents-compliant and wraps every message with routing metadata, body, headers, and custom attributes.
Every message follows the same deterministic path. Every stage is logged. Every failure is captured with full context for debugging and compliance.
edgeStream.publish({ topic, body, meta }) — enters the outgoing pipeline immediately.Follow the get-started guide or browse real integration examples.