EventsOverview

Events Overview

This section covers how you work with events in application development — declaring payloads, naming conventions, dispatching from rules, versioning, and testing.

For the append-only ledger and replay, see Replay and Debugging — Ledger Events.


How events fit into Causet

Events are facts appended to the ledger. Intents emit them. Projections consume them.


Declaring events

# app.causet
includes:
  events: [./events/**/*.events.causet]
events:
  ARTIST_FOLLOWED:
    state: user
    entity_expr: event.user_id
    payload:
      user_id:   string
      artist_id: string

In this section

PageWhat it covers
ConceptFacts vs commands, global event registry
Defining Eventsstate, entity_expr, payload types, kind
Event NamingPast tense, domain prefixes
Event MetadataEnvelope fields and event.ts
Dispatching Eventsop: emit from rules
Event VersioningSafe schema evolution
System EventsOperational event kinds
Testing EventsFixtures and replay in tests
Best PracticesReserved fields, naming mistakes
ExamplesConcert-domain event catalog

Next steps