@statesync/pinia

Pinia adapter for state-sync — automatic store synchronization
926 18
Install
npm install @statesync/pinia
Latest Version:2.0.0
License:MIT
Last Updated:Feb 13, 2026
Links: GitHub  ·  npm
Maintainer: ilyazelenko

@statesync/pinia

Pinia adapter for state-sync. Applies snapshots to a Pinia store.

Install

npm install @statesync/pinia @statesync/core

Quick Start

import { createRevisionSync } from '@statesync/core';
import { createPiniaSnapshotApplier } from '@statesync/pinia';

const store = useMyStore();

const applier = createPiniaSnapshotApplier(store);

const handle = createRevisionSync({
  topic: 'settings',
  subscriber: mySubscriber,
  provider: myProvider,
  applier,
});

await handle.start();

Modes

Patch (default)

const applier = createPiniaSnapshotApplier(store);
// Calls store.$patch(data) — merges fields

Replace

const applier = createPiniaSnapshotApplier(store, { mode: 'replace' });
// Full replacement: deletes missing keys, assigns new ones

Options

  • toState(data, ctx) — map snapshot data → state patch
  • pickKeys / omitKeys — limit which keys are updated
  • strict (default: true) — throw if toState returns a non-object

See full documentation.

Related Packages

pinia-plugin-logger

Logger for Pinia

2,311 4
@vaxee/nuxt

Nuxt Module for Vaxee

1,857 74
vaxee

Vaxee is a simple and easy-to-use library for Vue 3 to manage the state of your...

1,324 74
@volverjs/query-vue

Repository pattern applied to a pinia store.

6,325 3

Version History

Version Released License
2.0.0 MIT
1.0.0 MIT