Skip to main content
The TypeScript client is generated into 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

TypeScript is the default language, so no flags are needed. This scaffolds repost/schema.repost with a starter user.created event and a .env file with an empty REPOST_SEND_API_KEY:
repost/schema.repost
With no output in the generator block, generation targets node_modules/.repost/client, which @repost/client re-exports.
3

Record the schema and generate

This records your schema as a migration and generates the client. Until a first generate has run, importing @repost/client fails with:
4

Connect an environment

Create an environment in the dashboard, copy its publish API key into .env, and deploy your schema:
Load .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.