Registry / database / syncly-engine

syncly-engine

JSON →
library0.1.10jsnpmunverified

Syncly Engine is a local-first database synchronization engine for Expo/React Native apps, implementing the transactional outbox pattern to reliably sync data with cloud backends (initially Firestore). Current version 0.1.10 is under active development and not production-ready. It uses SQLite as the single source of truth, ULID keys for sortable IDs, soft deletes via deletedAt, and a provider abstraction for swappable cloud adapters. Key differentiators: offline-first, atomic writes of business data and sync payloads, conflict resolution tracking.

npm install syncly-engine
INSTALL
IMPORT
SIG · SYNCLY-ENGINE
S
syncly-engine
databasejavascriptv0.1.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SynclyClient
import { SynclyClient } from 'syncly-engine'
const SynclyClient = require('syncly-engine')
ESM-only; no CJS support
SynclyClient
import SynclyClient from 'syncly-engine'
const { default: SynclyClient } = require('syncly-engine')
Default export available but named export preferred
FirestoreSyncAdapter
import { FirestoreSyncAdapter } from 'syncly-engine'
import { FirestoreProvider } from 'syncly-engine'
Exact class name; no alias exists
type SyncConfig
import type { SyncConfig } from 'syncly-engine'
import { SyncConfig } from 'syncly-engine'
SyncConfig is a TypeScript type, use type import for tree-shaking

Demonstrates initializing SynclyClient, attaching a Firestore adapter, starting periodic sync, inserting a record into the local repository (which automatically queues a sync payload), and stopping sync.

import { SynclyClient, FirestoreSyncAdapter } from 'syncly-engine'; // Initialize the sync client const client = new SynclyClient(); await client.initialize(); // Configure a Firestore adapter (requires Firestore instance) const firestore = getFirestore(); // from firebase/firestore const adapter = new FirestoreSyncAdapter(firestore, { collectionPrefix: 'syncly_' }); // Start syncing periodically (every 30 seconds) client.startSync(adapter, { intervalMs: 30000 }); // Use repository to write data (local-first) const entity = await client.repository.insert('tasks', { title: 'Buy groceries', completed: false }); // Data is automatically queued for sync // Stop syncing when done client.stopSync();
Debug
Known issues
gotchaPre-1.0.0 API instability: APIs may change without notice until stable release.
fix
Pin to exact version and expect breakage on updates.
affects: <1.0.0
gotchaFirestore only: currently only FirestoreSyncAdapter is implemented; other providers not available.
fix
Use Firestore or implement custom adapter.
affects: >=0.1.0
gotchaRequires Expo: this library is designed for Expo managed/bare workflows; may not work in vanilla React Native without Expo modules.
fix
Use expo-dev-client or eject to bare workflow.
affects: >=0.1.0
gotchaNo CJS support: package is ESM-only; cannot be required() in Node.js environments.
fix
Use import syntax; for Jest, configure transformIgnorePatterns.
affects: >=0.1.0
Errors
Common errors & fixes
Module not found: Can't resolve 'syncly-engine'
Package not installed or incorrectly imported.
fix
Install with: npm install syncly-engine
TypeError: Cannot read properties of undefined (reading 'repository')
Client not initialized before accessing repository.
fix
Await client.initialize() before using client.repository.
FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created
Firebase not initialized before creating FirestoreSyncAdapter.
fix
Call initializeApp() before getFirestore().
Upgrade
Version history
0.1.10latest on npm
Audit
Dependencies
exporequiredRequires Expo environment (managed or bare workflow)
reactrequiredPeer dependency for React Native apps
react-nativerequiredPeer dependency for React Native runtime
Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
1
Resources
syncly-engine — npm install syncly-engine · libregistry