Installation
Pick the narrowest Coaction entry point and framework package for your application.
Coaction requires Node.js 22 or newer for repository development. Published runtime packages are installed from npm with the package manager you already use.
Vanilla applications
For a local-only store, install the core and import the transport-free entry:
pnpm add coactionimport { create } from 'coaction/local';coaction/local gives bundlers a hard boundary that excludes the JSON protocol, epoch,
reconnect, and transport runtime. Prefer it for new vanilla applications that do not use
workers.
Use the shared entry when state crosses a Worker, SharedWorker, or injected transport boundary:
import { create } from 'coaction/shared';The root coaction entry is a compatibility entry. It retains both local and shared mode
selection, but it is intentionally broader than coaction/local.
Framework packages
Install the core plus one framework binding:
pnpm add coaction @coaction/react| Framework | Package | Primary reactive API |
|---|---|---|
| React 17–19 | @coaction/react | create(), observer(), <Observer> |
| Vue | @coaction/vue | callable store and computed selectors |
| Angular | @coaction/ng | store.select() signal |
| Svelte | @coaction/svelte | readable selector store |
| Solid | @coaction/solid | selector accessor |
See framework integrations for runnable examples.
Optional integrations
Install only the integration that owns or decorates your state:
# Existing external state runtimes
pnpm add coaction @coaction/zustand zustand
pnpm add coaction @coaction/mobx mobx
pnpm add coaction @coaction/pinia pinia
# Coaction-owned store middleware
pnpm add @coaction/logger
pnpm add @coaction/persist
pnpm add @coaction/history
# Yjs collaboration
pnpm add @coaction/yjs yjsExternal-state adapters are whole-store bridges. Do not place a Zustand, MobX, Pinia, Jotai, Redux, Valtio, or XState adapter under a native Coaction slice key.
Entry-point map
| Import | Intended audience |
|---|---|
coaction/local | Local vanilla stores and signal primitives |
coaction/shared | Local stores, shared authorities, and client mirrors |
coaction/adapter | Authors of external-store adapters and low-level middleware |
coaction | Compatibility entry with shared-capable create() |
Shared code must move together
Do not deploy a new shared client against an authority running a different Coaction major. Upgrade the Worker/SharedWorker authority and all clients as one deployment unit.
Next, create a store.