@teamanalyst/schema
v0.0.1
Published
Shared event schema (Zod) and types for the Analyst analytics platform.
Readme
@teamanalyst/schema
Shared event contract for the Analyst analytics platform: hand-written TypeScript types plus Zod schemas for runtime validation at the ingest boundary.
npm install @teamanalyst/schemaimport { trackRequestSchema, analyticsEventSchema, MAX_INGEST_BATCH_SIZE } from "@teamanalyst/schema";
const result = trackRequestSchema.safeParse(await request.json());
if (!result.success) {
// quarantine — never silently drop
}Exports:
AnalyticsEvent,TrackRequest,EventProperties,JsonValue— pure typesanalyticsEventSchema,trackRequestSchema,eventPropertiesSchema,jsonValueSchema— Zod schemasMAX_INGEST_BATCH_SIZE,MAX_ID_LENGTH,MAX_EVENT_NAME_LENGTH,EVENT_NAME_PATTERN— limits & conventions
The client SDK (@teamanalyst/sdk) mirrors these types without importing this package, keeping it dependency-free; its test suite asserts the mirror never drifts.
License
MIT
