NexusConfig interface, passed to <NexusProvider config={...}>. The provider also accepts a few props that control its render lifecycle.
NexusConfig
NexusProvider props
API key types
Browser SDKs must use a
wxp_... key. The SDK enforces this in three places:
PublicApiKeybranded type - when typed strictly, TypeScript prevents passing a plainstringwithoutassertPublicKey()- Runtime guard - throws
Error('Browser SDKs require a public key (wxp_...)')before any network call - Backend enforcement - a request carrying an
wxs_...key in theX-Nexus-API-Keyheader against a browser/public surface is rejected with400 Bad Request
Where to keep the API key
Anywhere your existing build pipeline injects environment-specific config - typically.env files for Vite / CRA, or NEXT_PUBLIC_* variables for Next.js. wxp_... keys are intended to be public, so embedding them in the built JavaScript bundle is fine.
