.repost schema into a Go package with model structs, enum constants, and typed methods under client.Webhooks. The generated package uses github.com/repost-sh/repost-go for validation, serialization, retries, transport, and delivery outcomes. The client requires Go 1.25 or later and belongs only in trusted server-side code.
1
Install the runtime
Add the runtime to your module:
2
Create a schema workspace
repost/schema.repost and .env. A Go generator always needs an explicit output because the generated package is committed with your application.repost/schema.repost
3
Record the schema and generate
internal/repostclient. Commit the migration, schema, and generated package together.4
Connect an environment
Create an environment in the dashboard, then put its publish API key in the Sign in and deploy the migration before sending the new event type:Load
.env file created by schema init:.env through your process manager or deployment platform. The Go runtime reads process environment variables; it does not load .env files itself.Your first send
CustomerID is the external ID of the customer receiving the event. The generated input requires the correct model type, and the runtime validates the value before opening a connection.
The idempotency key is optional. Without one, the runtime creates a key and reuses it for that operation’s internal retries. Supply a stable business key when a queue redelivery, process restart, or application retry can repeat the same logical send. See Reliable sends before adding your own retry loop.
Create one client for each application process. It owns bounded connection pools and an observer dispatcher. Close it during graceful shutdown rather than constructing and closing a client in every request handler.
Continue
Code generation
Generated files, optional values, regeneration, and version checks.
Configuration
Credentials, deadlines, capacity, proxy, TLS, DNS, and HTTP/2.
Reliability
Idempotency, delivery states, cancellation, retries, and backpressure.