Skip to content

Interface: EvalwrightClientOptions ​

Construction options for EvalwrightClient.

Properties ​

apiKey ​

ts
apiKey: string;

A key created under API keys in the Evalwright app. Keep it on the server: anything holding it can resolve every prompt deployed to the key's environment.


baseUrl ​

ts
baseUrl: string;

The address of the Evalwright API, e.g. https://api.example.com — without /v1, which the SDK adds itself. Trailing slashes are stripped.

Required, with no default: every call carries the API key, so a default address is a host that receives keys from everyone who forgot to set one.


cache? ​

ts
optional cache?: CacheOptions;

In-memory caching of prompts — see CacheOptions.


logging? ​

ts
optional logging?: LoggingOptions;

Diagnostics. Quiet by default (warn), and routed to your own logger if you pass one — see LoggingOptions.


realtime? ​

ts
optional realtime?: boolean;

Keep a stream open to hear about deploys the moment they happen, so the cache refreshes at once instead of when its TTL runs out. Off by default: an open stream keeps a Node process alive, so a long-running server wants it and a script does not. Call EvalwrightClient.close on shutdown. If the server has no realtime configured, this quietly does nothing.


timeoutMs? ​

ts
optional timeoutMs?: number;

How long one request to the API may take, in whole milliseconds, before it fails with a TimeoutError. Defaults to 10000; at most 2147483647. A refresh that times out leaves the cached prompts serving, like any other failed refresh.

Released under the MIT licence.