Nexus State Documentation
Overview and navigation for the Nexus State subsystem.
Nexus State is the synchronized remote-state subsystem for Nexus. It provides a headless runtime through the @nexus-js/core/state entrypoint and React bindings in @nexus-js/react.
Use this section for Nexus State-specific setup, runtime semantics, and API details.
Create a StoreToken with createStoreToken<Store>(id, options?), then create stores with const { provider, store } = createNexusStore(token, nativeCreator, options) and register provider through the ordinary provider path, for example nexus.configure({ providers: [provider] }). The returned store is the original native Zustand API. For an already-created store, use bindNexusStore(token, store, options) instead. The required options explicitly project shared data with snapshot and allow remote action keys with expose; publishWindowMs defaults to 200 and maxPendingSnapshots to 32. State connection options use the Core ConnectOptions shape: exact target, acquisition where, positive timeout, and optional signal. There are no State-specific default targets or provider wait options.
For general application-level unit tests with an injectable mock NexusInstance, also read Testing.
Start Here
- New to Nexus State: Quick start
- Mental model and lifecycle semantics: Concepts
- Headless API reference: Core API
- React integration guide: React
- Lifecycle and error behavior: Lifecycle and errors
- Testing guidance: Testing
- Common questions: FAQ
Package Routing
- Headless runtime entrypoint:
@nexus-js/core/state(from@nexus-js/core) - React bindings:
@nexus-js/react - Foundation framework:
@nexus-js/core - Application unit testing utilities:
@nexus-js/testing
If you are looking for product-level Nexus docs, go to Nexus Documentation.