Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@syncular/client

Latest version: v0.105.10

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: bkniffler
321 Stars
15 Forks
154 Versions
23.9K Downloads
TypeScript Repo language

Scan summary

@syncular/client was last scanned on 23 Nov 2026 at version 0.105.10. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 154 versions; the latest 5 were published on 23 Nov 2026.
  • Findings: No rules fired in version 0.105.10.
  • Downloads: 23,854 downloads.

Versions

154 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.105.10 LATEST 23 Nov 2026 No rules fired
0.105.9 23 Nov 2026 No rules fired
0.105.8 23 Nov 2026 No rules fired
0.105.7 23 Nov 2026 Not shown
0.105.6 23 Nov 2026 Not shown

No rules fired in 0.105.10

Findings

Findings for v0.105.10. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.105.10; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@syncular/client

The TypeScript client protocol core (SPEC.md §§3–8, client side) plus its browser platform bindings.

The normal SyncClient also runs in a CLI or background service. Use openSqliteDatabase(path) from @syncular/client/sqlite for a persistent local replica on Node or Bun. See the server-side sync client guide.

SyncRemoteClient is the database-less server client. It sends ordinary push-only commits through /sync and can call registered typed queries, server-authoritative commands, and live query watches through the remote operation transport. See remote server operations. Its schema and sync transport are optional for query-only or command-only processes. Without a logEpoch, the first prepareCommit sends one empty pull to learn the partition log epoch and binds every later commit to it; set logEpoch in the constructor to skip that round.

Applied and cached acknowledgements drain the send queue while protected local intent stays visible until the same row's server image arrives at that commit sequence or later. Empty pulls and restart preserve it; later edits stack above it. This behavior is automatic, independent of retainFailedCommits. The core requests a following pull without relying on an origin realtime notification. See optimistic writes.

Built-in FTS5 projections

Typegen turns an fts declaration into a built-in local projection: every projection column names a string source column. The client stores it as an external-content FTS5 table under the projection name, with its content in _syncular_projection_<name> and the source-ID mapping in _syncular_fts_<name>. Triggers on the source table write the content row and the index entry in the statement that writes the source row, and remove them with it. Every open compares the content, mapping and index counts with the source row count and rebuilds from the source rows on a mismatch. A missing FTS5 build fails schema setup; Syncular does not substitute a LIKE scan. Encrypted string columns index the decrypted local plaintext.

Built-in projections run in the projection implementation. Pass createProjections from @syncular/client/projections to SyncClient, or to startSyncWorker in a worker, whenever the schema declares a projection. Without it, construction fails with client.schema_invalid and { reason: 'projections_unavailable' }.

Browser modes — there are exactly two

Persistent worker mode is THE mode. The whole client core — SyncClient, the fetch/WebSocket transports, and SQLite on the opfs-sahpool VFS — runs inside a Web Worker. The UI thread talks to it through a thin postMessage RPC:

// worker.ts — the worker entry your bundler emits as its own script
import { startSyncWorker } from '@syncular/client/worker';
startSyncWorker();

Use @syncular/client/worker/remote for a worker that only connects to a remote authority. It omits the local-authority lifecycle from the worker bundle while preserving the normal client and multi-tab APIs. It refuses an initialization with localAuthority: true before opening storage using client.local_authority_unconfigured. The shared handle still declares its local-authority methods; those calls fail with client.worker_method_unavailable on a remote-only worker. Use @syncular/client/worker to run a local authority.

// main thread
import { createSyncClientHandle } from '@syncular/client';

const handle = await createSyncClientHandle({
  worker: () => new Worker(new URL('./worker.ts', import.meta.url), { type: 'module' }),
  schema,
  database: { mode: 'persistent', name: 'app' }, // OPFS, survives reloads while the origin remains stored
  endpoints: {
    syncUrl: '/sync',
    segmentsUrl: '/segments',
    realtimeUrl: 'wss://example.com/realtime?clientId={clientId}',
  },
});
if (handle.role === 'follower') {
  // Another tab owns the core for this origin. The default multi-tab mode
  // transparently proxies this handle to that leader.
}
await handle.subscribe({ list_id: 'l1' });
await handle.syncUntilIdle();
const rows = await handle.query('SELECT * FROM todos');

The handle exposes the same logical API as SyncClient (subscribe / mutate / sync / query / conflicts / …), every method a promise. It acquires the Web Locks leader lock before spawning the worker — one core per origin. Wake-ups are handled inside the worker (autoSync, SPEC §8.4); the supported page-level realtime supervisor owns reconnect and resume policy. The handle's listener methods (onSyncNeeded, onConflict, onSynced, onUpgrading, onPresence, onDiagnostics, onRoleChange, onLeadershipChange, onLeaderUnreachable) each return an unsubscribe function and fire in every tab, followers included. handle.onSynced(listener) reports the end of each drive to idle, automatic or requested by any tab.

For a reviewed recovery from a retained conflict or rejection, call await client.proveCurrentBase(outcome). The result contains bases for every retained row only after a completed covering pull, or a typed failure reason without row data. Use the returned versions in the replacement commit.

A direct SyncClient used by a long-running service exposes onSyncNeeded() and onSyncIntent(). Install the shared single-flight loop instead of maintaining host timers:

const scheduler = installSyncScheduler(client, { onError: reportSyncError });
// During shutdown:
scheduler.stop();

Creation-time window helpers produce immutable UTC month scope values. creationTimeBucket(createdAtMs, 'month') returns YYYY-MM, and last(3, 'month') returns the current and preceding two buckets oldest first.

OPFS is best effort until the browser grants origin persistence. The page owns that decision because StorageManager.persist() is a Window API and should be requested from a user action:

import {
  checkBrowserStoragePersistence,
  requestBrowserStoragePersistence,
} from '@syncular/client';

const current = await checkBrowserStoragePersistence();
const requested = await requestBrowserStoragePersistence(); // user action

Each call returns persistent or a structured best-effort reason. Keep the client usable after denial, display the state, and warn whenever best-effort storage contains pending outbox commits. Origin eviction removes OPFS and its outbox together; persistence does not prevent a user from clearing site data.

Ephemeral in-memory mode is EXPLICIT. openWasmDatabase() returns an in-memory sqlite-wasm database for tests, demos and SSR. Nothing persists, on purpose, and that is the only main-thread mode.

Supported realtime lifecycle

Register units, then install the cross-host supervisor:

import {
  browserConnectivitySignal,
  documentLifecycleSignal,
  installRealtimeSupervisor,
} from '@syncular/client';

await handle.subscribe({ list_id: 'groceries' });
installRealtimeSupervisor(handle, {
  connectivity: browserConnectivitySignal(),
  lifecycle: documentLifecycleSignal(),
  // Encrypted/locked apps also pass their active/preflight signal.
  protection,
});

It owns one connection attempt at a time, retries initial failure and later socket loss with bounded exponential jitter, suspends while offline/background/protected without resetting that backoff, runs syncUntilIdle() before reporting connected, and settles its attempt and disconnect before close() closes the client. A refused disconnect counts one retry. A first diagnostics read, connect or catch-up round that another tab's security preflight refuses waits in phase protected until that tab activates. Any other unreadable first diagnostics read, or a throwing timer cancel, latches phase unsupported with a failureCode, and close() rejects with a RealtimeSupervisorError of that code.

Multi-tab handles share ONE leader socket across every tab, so pass sharedTransport: true (the templates do): backgrounding this tab then leaves the shared socket alone — a sibling tab may still be visible — while offline and protection continue to suspend. Each client accepts exactly one supervisor for its lifetime; a second installRealtimeSupervisor call throws realtime.supervisor_already_installed. realtimeSupervisorSnapshot() and subscribeRealtimeSupervisor() expose only phase, attempt, and the bounded library delay for UI/diagnostics—never raw transport prose or identities.

The lower-level connectRealtime() is idempotent while connected and single-flight while connecting; disconnect invalidates an in-flight result so it cannot install a stale socket. It remains available for custom host loops. HTTP rounds still work with no socket, but do not imply continuous convergence: a host trigger must actually run them. See the complete realtime lifecycle guide.

Multi-tab followers

By default, every tab of the same origin shares ONE core: one sync loop, one WebSocket, one OPFS database, N tabs.

const handle = await createSyncClientHandle({
  worker: () => new Worker(new URL('./worker.ts', import.meta.url), { type: 'module' }),
  schema, database: { mode: 'persistent', name: 'app' }, endpoints,
});
handle.onRoleChange((role) => console.log('now', role)); // 'follower' → 'leader'
// Compatibility: handle.role is 'leader' or 'follower'.
// Detailed state: handle.leadership / handle.leadershipSnapshot().
handle.onLeadershipChange((state) => renderConnectionState(state));

Topology. The tab that wins the Web Locks election is the leader: it holds the lock, spawns the worker, and runs the core (the single-tab path, unchanged — the lock IS the exactly-one-core invariant, and a worker is never spawned without it). Every other tab is a follower: it opens a BroadcastChannel to the leader and proxies the whole logical API over it (req/res), while the leader fans its worker events — exact revisioned change batches plus presence / conflict / sync-needed / synced / upgrading — out to all followers (event). Queries forward to the leader's one DB; rows (including bytes columns) ride back through structured clone.

Promotion. When the leader tab closes, its lock releases. Followers are already blocked on lock.acquire; Web Locks grants it to exactly one, and that tab promotes in place — spawns the worker over the same OPFS database (which persisted; the server is the source of truth, so nothing is replayed beyond the outbox the core already holds), re-announces on a new epoch, and flips its role to 'leader'. Remaining followers rebind to the new leader on its announce. The handle object is kept across the transition, so a React SyncProvider holds a stable reference.

Epoch (generation token). Each leader announces a monotonically increasing epoch. Followers stamp requests with the epoch they last heard; a leader ignores stale-epoch requests, and a follower discards any res/event from an epoch other than its current one — so a late reply from a tab that has since died can never be mistaken for a live answer. Calls made during the handover gap are queued with a deadline and flushed to the new leader on its announce; past the deadline they fail loudly with client.follower_timeout (never a silent hang), and an overflowing queue rejects rather than growing unbounded.

Leader liveness. Followers probe the leader; the leader runs no liveness timer. A bound follower that has heard no announcement for a third of followerCallTimeoutMs (default 10 s) posts a hello, and the leader answers every hello with an announcement from its message handler. Browsers throttle the timers of hidden tabs (Chrome's intensive throttling wakes them about once a minute) but still dispatch their BroadcastChannel messages, so a leader in a background tab keeps its followers bound. When a probe stays unanswered for the rest of followerCallTimeoutMs, handle.leadership becomes { state: 'blocked', reason: 'leader-unreachable', code: 'client.follower_timeout', retryable: true } and calls reject immediately. A leader tab that processes no messages (hung or frozen) therefore blocks its followers within followerCallTimeoutMs; a closed leader releases its Web Lock and hands over without waiting for that deadline. A blocked follower keeps probing at the same interval: an answer rebinds the same handle, and a granted Web Lock promotes it. An unreachable BroadcastChannel is never treated as evidence that the lock owner is stale, so it never authorizes a second worker or database owner.

Forwarded calls have no deadline. The leader's core serializes window edits and sync rounds, so a follower's setWindow can wait behind a long bootstrap download, exactly as the same call does in the leader tab. While the leader answers probes, a forwarded call waits for its result. It rejects with client.follower_timeout when the link goes blocked, with client.leader_handover when another leader announces or this tab promotes before the answer arrives, and with client.worker_failed when the handle closes. Only calls queued while no leader is bound keep the followerCallTimeoutMs deadline; when this tab wins the lock itself, its own core runs them.

Tabs of different builds never serve each other. Every hello, req, and announce carries MULTI_TAB_PROTOCOL_VERSION and the schema version. A follower whose leader differs sends it nothing: handle.leadership becomes { state: 'blocked', reason: 'leader-incompatible', code: 'client.leader_incompatible', leader: 'older' | 'newer', retryable: true } and calls reject with client.leader_incompatible. A leader that hears a hello from a newer tab closes its core and releases the Web Lock; the newer tab promotes, and the former leader stays blocked with leader: 'newer' until it reloads. A leader answers a request with another identity with a client.leader_incompatible error. Tabs running 0.29.1 or older send no identity and count as older: they never step down, so a newer tab next to one shows leader: 'older' until that tab reloads or closes. Bump MULTI_TAB_PROTOCOL_VERSION with every change to a message shape or to a forwarded method's arguments or result: test/multi-tab-protocol.test.ts pins a fingerprint of that surface to the constant and fails until both change together.

A hidden leader keeps leadership. A visible tab does not take leadership from a hidden leader. Web Locks steal revokes the lease while the leader's worker still holds the OPFS database and may be mid-commit, so a transfer needs a cooperative close-and-release handshake, and every focus change between tabs would restart the worker, reopen the database, and reconnect the realtime socket. A hidden leader answers its followers from its message handler, so leadership moves only when the leader tab closes, or when the user takes over from an unresponsive one.

Taking over from an unresponsive leader. A leader whose main thread runs no task (a frozen background tab, a hung window) blocks its followers with leader-unreachable. Once that has lasted takeOverAfterMs (default twice followerCallTimeoutMs), handle.takeOver(), called from a user action, steals the leader's Web Lock, starts the worker in this tab on a higher epoch, and steals the old worker's OPFS storage lock. OPFS sync access handles are exclusive, so the new worker opens the database only after the old one closed it. The old worker's database refuses every statement once its storage lock is gone (client.storage_fenced) and closes its handles, and the old tab becomes blocked with reason leadership-taken when it runs again. takeOver() rejects with client.takeover_refused (details.reason: not-unreachable, too-early, in-progress, unsupported) and with client.storage_busy while a frozen worker still holds the files. onLeaderUnreachable reports the start of each unreachable period with takeOverAt, and its end with durationMs and the outcome.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @syncular/client

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229