Skip to content
Strata Sync

AI agents: fetch the documentation index at llms.txt. Markdown versions are available by appending .md to any page URL, including this page's markdown.

@stratasync/core

Core model runtime, schema metadata, transaction primitives, and delta processing for Strata Sync.

Installation

npm install @stratasync/core

@stratasync/core has no peer dependencies. It bundles mobx as a regular dependency.

Package exports

Import all public APIs from the package entry point:

import {
  // Models
  Model,
  Collection,

  // Decorators
  ClientModel,
  Property,
  Reference,
  ManyToOne,
  OneToMany,
  BackReference,

  // Schema
  ModelRegistry,
  computeSchemaHash,

  // Transactions
  createInsertTransaction,
  createUpdateTransaction,
  createDeleteTransaction,
  createUndoTransaction,
  serializeTransaction,
  deserializeTransaction,

  // Sync
  applyDeltas,
  createBatchedApplier,
  rebaseTransactions,

  // Utils
  generateUUID,
  generateModelId,
  getOrCreateClientId,
} from "@stratasync/core";

Serialization helpers, ephemeral properties, reference collections, and internal utilities are also available from the same entry point.

Architecture role

Sits at the bottom of the dependency graph. Defines the data model, schema, and transaction format that all higher-level packages consume.

core
  ^-- y-doc
  ^-- client
        ^-- react
              ^-- next

Framework-agnostic: works in Node.js, Deno, or any ES module runtime.