NexusConfig is a constructor-promoted value object holding every setting required to build a client. Pass it to NexusClient::create.
Field reference
API key types
Where to keep the API key
Use environment variables - never hardcode the key in source:Choosing the TTL
The TTL controls how long the in-memory cache is considered fresh before a background sync is triggered. With SSE enabled (connectStream()), changes propagate within milliseconds regardless of the TTL - the TTL only matters as a fallback when the stream is not running (FPM request handlers, for example).
In PHP-FPM, each request creates a fresh PHP process, so the cache is always empty at the start of a request and the TTL has no staleness effect across requests. The TTL is relevant only for long-running CLI daemons and queue workers.
Custom Guzzle client
The factory method accepts an optional Guzzle client as its second argument:Do not set a
timeout that is too short - the initial sync is blocking and must complete before create returns. 10 seconds is a sensible minimum.WifConfig overview
When you pass aWifConfig to NexusConfig::$wif, the SDK skips the static apiKey on every request and instead exchanges a workload OIDC token for a Nexus session JWT:
tokenSource closure, and token exchange details.