createRepostClient() snapshots and validates its configuration. Fixed credentials and the API URL are resolved at construction; an apiKeyProvider is resolved once for each admitted send.
Client options
With no key available, a send throws
RepostConfigurationError with error code CONFIGURATION and delivery state NOT_SENT.
Every request goes to POST <apiUrl>/v1/messages with authorization: Bearer, content-type: application/json, and idempotency-key headers.
Transport tuning
Retries and operation deadlines belong to the client runtime. Network and connection-pool settings belong underhttpTransportOptions:
The deprecated
maxRetries, baseDelayMs, and timeoutMs fields are still translated when they appear inside httpTransportOptions on the client. Passing them directly to createHttpTransport() or createNodeTransport() is rejected because a transport executes exactly one attempt.
Generators
The runtime asks three injectable functions for values it has to invent:now for the envelope timestamp and @default(now()), uuid for @default(uuid()) and minted idempotency keys, and cuid for @default(cuid()).
new Date().toISOString(), crypto.randomUUID(), and cuid2. Only the functions you set are overridden. now is called once per send and memoized, so the envelope timestamp and any now() default inside the same event always match.
Continue
Reliability
Retries, idempotency, and the error surface in detail.
Testing
The stub transport and deterministic generators in practice.
HTTP API
The endpoint these options point the client at.