node_modules, and the @repost/client package re-exports it, the same way Prisma’s client works. Your application imports one stable package; generation fills it with types from your schema.
Node.js 20 or later is required.
1
Install the CLI and the runtime
2
Create a schema workspace
repost/schema.repost with a starter user.created event and a .env file with an empty REPOST_SEND_API_KEY:repost/schema.repost
output in the generator block, generation targets node_modules/.repost/client, which @repost/client re-exports.3
Record the schema and generate
@repost/client fails with:4
Connect an environment
Create an environment in the dashboard, copy its publish API key into Load
.env, and deploy your schema:.env through your framework, your process manager, or Node’s --env-file option.Your first send
createRepostClient() never throws; the API key resolves from REPOST_SEND_API_KEY at send time, so a missing key surfaces on the first send. customerId names the customer receiving the event. The idempotencyKey is optional; reusing it with the same payload is safe, and Reliability explains when to pass your own.
TypeScript rejects unknown events, missing fields, and incompatible values before the send ever reaches Repost.
Continue
Code generation
What lands in
node_modules, and how regeneration works.Configuration
Client options, transport tuning, and injectable generators.
Reliability
Retries, idempotency, and the error surface.