Skip to main content
NexusConfig is a frozen dataclass holding every value required to construct a client. Pass it to NexusClient.create() or AsyncNexusClient.create() (both accept the same instance).

Field reference

WIFConfig fields

Constructed with keyword arguments only. See Workload identity for the full picture. WIFProvider, WIFProviderLiteral, WIFProviderLike, ExchangeContext, ExchangePayloadSource, ExchangeSource, TokenSource, TokenSourceResult and ExchangePayloadResult are all exported from westyx_nexus, so the callbacks the SDK asks for can be named and annotated.

API key types

Calling get_secret(...) with a public key raises NexusPublicKeyError synchronously, before the network call.

Where to keep the API key

Anywhere your existing config pipeline puts secrets - environment variables, AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, or a local .env file in dev. The SDK never logs the raw key.
For Pydantic / pydantic-settings users:

Choosing the TTL

The TTL is a tradeoff between staleness window and redundant network traffic. With SSE enabled (default), changes propagate in milliseconds regardless of the TTL - the TTL only matters as a safety net if the stream falls back.

Disabling SSE

Useful in environments where outbound long-lived connections are blocked (some serverless platforms, certain corporate proxies).

Environment variables

Framework adapters

The Flask extension (app.config) and the Django app (settings.py) read NEXUS_BASE_URL, NEXUS_API_KEY, NEXUS_WIF, NEXUS_TTL_SECONDS and NEXUS_STREAM. Every setting is optional. NEXUS_BASE_URL falls back to WESTYX_SERVICE_ENDPOINT; NEXUS_WIF takes a WIFConfig or a mapping of its fields ({"enabled": True, "provider": "kubernetes"}). With neither NEXUS_API_KEY nor NEXUS_WIF the adapter uses Workload Identity Federation with the default provider, which finds the session westyx dev setup wrote - so under westyx dev run it needs no Nexus settings at all. See Framework adapters.