Getting started

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 coaction
import { 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
FrameworkPackagePrimary reactive API
React 17–19@coaction/reactcreate(), observer(), <Observer>
Vue@coaction/vuecallable store and computed selectors
Angular@coaction/ngstore.select() signal
Svelte@coaction/sveltereadable selector store
Solid@coaction/solidselector 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 yjs

External-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

ImportIntended audience
coaction/localLocal vanilla stores and signal primitives
coaction/sharedLocal stores, shared authorities, and client mirrors
coaction/adapterAuthors of external-store adapters and low-level middleware
coactionCompatibility 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.

On this page