Event schema. Your events are defined as data.
Every app defines its own event catalogue in the panel. Postlip Metrics has no fixed list of events: event names, their properties and their meaning are the app’s data, and every message is validated against this catalogue.
Event and property definitions
An event definition carries its name, description, business role, status and properties. Every property has:
- a type (
string,number,integer,boolean,datetime,currency,money,enum,object,array), - whether it is required, and its constraints (a list of values, a maximum length, a minimum/maximum),
- a personal data class (
none,pseudonymous,personal,sensitive) and an action (allow, hash, drop, reject).
Person and account traits
Person traits sent with identify and account traits sent with group are defined apart and validated with the same rules.
Statuses
Validation modes
The mode is chosen per app and decides what happens to undefined events and properties. Defined ones are checked against their definition in every mode.
Discovered events and version history
- Undefined events gather in the Discovered inbox; Add as definition turns one into a definition, or it is ignored.
- Every change to the schema is a revision; the change history keeps who changed what and when, with the value before and after.
Export and CI
- The JSON Schema document of an event:
GET /v1/apps/{appId}/event-definitions/{eventId}/json-schema. - The whole schema in one bundle:
GET /v1/apps/{appId}/schema. metrics pullgenerates TypeScript types and a typedtrackfrom the schema;metrics validatechecks sample events in CI.