Skip to main content
NexusConfig is a plain TypeScript interface holding every value required to construct a NexusClient. Pass it to provideNexus(...) (standalone) or NexusModule.forRoot(...) (NgModule).

Field reference

API key types

Browser SDKs must use a wxp_... key. The SDK enforces this in three places:
  1. PublicApiKey branded type - when typed strictly, TypeScript prevents passing a plain string without assertPublicKey()
  2. Runtime guard - throws Error('Browser SDKs require a public key (wxp_...)') before any network call
  3. Backend enforcement - a request carrying an wxs_... key in the X-Nexus-API-Key header against a browser/public surface is rejected with 400 Bad Request

Where to keep the API key

Anywhere your existing build pipeline injects environment-specific config - typically Angular’s environments/environment.ts:
wxp_... keys are intended to be public - embedding them in a built JavaScript bundle is fine. They cannot read secrets, and the Double-Gate check ensures they only work on the correct subdomain.

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 when the stream falls back.