# Webhooks out. Webhooks in. Same terminal.

The Repost CLI covers the contract-to-delivery workflow and the inbound
capture-to-localhost workflow without hiding the steps CI needs to reproduce.

## Send the first typed event

1. Run `repost schema init` in the repository.
2. Define a catalog event and its payload model in a `.repost` schema.
3. Run `repost schema fmt` and `repost schema validate`.
4. Create a reviewable migration with `repost schema migrate dev`.
5. Generate the TypeScript client with `repost schema generate`.
6. Deploy pending migrations with `repost schema migrate deploy`.
7. Call the generated webhook method with a customer ID and typed data.

CI can check formatting, schema validity, migration checksums, and deployed
history position before a release. Generated payload fields and enum values are
available to editor suggestions and the TypeScript compiler.

## Bring production-shaped traffic to localhost

1. Run `repost init` to create an inbound bucket and forwarder.
2. Point a webhook provider at the bucket URL once.
3. Run `repost forward` to stream live traffic or the retained backlog to
   localhost.
4. Run `repost replay` to re-fire a captured request at the handler.
5. Use `repost expect` in CI to wait for a matching webhook instead of sleeping.

Inbound requests are stored before acknowledgment, so localhost can be offline
without discarding the traffic needed to debug or test the integration.

## Continue

- [Understand the schema workflow](/product/webhook-schema.md)
- [Use the generated sending client](/product/send-webhooks.md)
- [Operate inbound webhooks](/product/inbound-webhooks.md)
