# `Chronicle.EventTypes`
[🔗](https://github.com/Cratis/Chronicle.Elixir/blob/main/lib/chronicle/event_types.ex#L4)

Registers event types with a Chronicle event store.

Called automatically by `Chronicle.Projections.Registrar` during startup.
You can also call it directly to register event types at runtime.

## Example

    {:ok, channel} = Chronicle.Connections.Connection.channel(:my_conn)
    :ok = Chronicle.EventTypes.register(channel, "my-store", [MyApp.Events.AccountOpened])

# `register`

```elixir
@spec register(term(), String.t(), [module()]) :: :ok | {:error, term()}
```

Registers a list of event type modules with Chronicle.

Each module must `use Chronicle.EventType`. Generates a minimal JSON schema
for each event type based on its struct fields.

Returns `:ok` on success or `{:error, reason}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
