repost schema generate produces a native client for your language: typed models for every payload and one method per event type.
Float is a compile error.
What every SDK does
The five SDKs are generated from the same schema and behave identically, verified by a cross-language test suite. In every language you get:- Payloads that match the schema exactly. Fields serialize in declaration order under their wire names, declared defaults such as
now()anduuid()are filled in, and absent optional fields are omitted rather than sent asnull. - Automatic retries. Network failures, timeouts, and retryable server responses are retried with backoff, up to four attempts, honouring
Retry-After. Other errors surface immediately as typed errors. - Idempotency by default. If you don’t pass a key, the SDK creates one per send and reuses it across its own retries, so a flaky connection cannot produce a duplicate. Pass your own key to make repeats safe across process restarts as well.
- A stub transport for tests. It validates and serializes for real but returns a canned result, so tests never touch the network.
- A version check at construction. A generated client and an incompatible runtime refuse to start, with a message saying whether to regenerate or upgrade.
REPOST_SEND_API_KEY at send time (an explicit apiKey option overrides it) and REPOST_API_URL when you target something other than https://api.repost.sh.
The publish key is a server-side secret. Don’t ship an SDK in a browser, a mobile app, or anything else your users can inspect.
Pick your language
Each language has its own guide covering setup, configuration, error handling, and testing:- TypeScript: generated into
node_modulesand re-exported by@repost/client, the same pattern Prisma uses - Go: a generated package you commit, with tri-state
Optional[T]fields - Python: a generated package you commit, with the
UNSETsentinel for optional fields - Java: Maven plugin, BOM, and Spring Boot or CDI injection
- Kotlin: Gradle plugin and a coroutine-first client
Testing
Every SDK ships a stub transport. Swap it in and tests publish for real, without a network:Continue
HTTP API
The endpoint underneath every SDK.
Quickstart
Generate a client and publish your first event.
Defining events
What each schema construct becomes in the generated client.