@zencomms/event-contracts
v0.1.0-alpha.2
Published
TypeBox schemas and TypeScript types for ZenComms outbound event payloads consumed by webhook subscribers (e.g. CRM integrations). Zero internal runtime dependencies.
Readme
@zencomms/event-contracts
TypeBox schemas and TypeScript types for ZenComms outbound event payloads consumed by webhook subscribers (e.g. CRM integrations). Zero-internal runtime dependencies — safe to install directly in external consumers without pulling the rest of the monorepo.
Scope follows ADR-001: only events verified against production source are included. Speculative events are rejected until a real emitter ships.
Install
pnpm add @zencomms/event-contractsStability
Alpha — APIs may change until 0.1.0.
Entry points
@zencomms/event-contracts— single root export at./dist/index.js.
Usage
import { parseEventEnvelope } from '@zencomms/event-contracts';
const result = parseEventEnvelope(rawWebhookBody);
if (result.ok) {
const event = result.value; // discriminated on event.type
if (event.type === 'call.initiated') { /* ... */ }
} else {
console.warn('rejected', result.error.code, result.error.message);
}See also
- See the root README for architecture and contributing.
- ADR-001 explains contract stability and the deferred-until-real-consumer philosophy.
