Skip to main content
NexusConfig is a plain TypeScript interface holding every value required to construct a client. Pass it to NexusClient.create().

Field reference

Other Westyx Nexus SDKs (Spring Boot, Python, Go, .NET) call this field baseUrl / BaseUrl / base_url. The Node.js SDK uses endpoint to match the original SDK contract; both names mean the same thing.

API key types

Calling getSecret(...) with a public key throws NexusPublicKeyError synchronously, before the network call.

Where to keep the API key

Standard Node.js practice - environment variables:
For more structured config, libraries like dotenv, convict, or zod work seamlessly:
The SDK itself never logs the raw key.

Choosing the TTL

The TTL is a tradeoff between staleness window and redundant network traffic. With SSE enabled (the default), changes propagate in milliseconds regardless of the TTL - the TTL only matters as a safety net if the stream falls back.
When SSE is connected, the SDK clamps the effective TTL to at least 60 s - there’s no point polling more aggressively when the stream pushes events the moment they happen.