Skip to main content


import * as Mycelial from '@mycelial/core';

const spore = Mycelial.create(namespace, key)

Creates a new spore(composition of CRDTs).

  • namespace (string) creates a namespace that acts as a topic when publishing changes.
  • key (number) a unique replica id, handler)

Creates event handlers, providing reactivity to changes.

  • event ('update' | 'apply') specifies which type of event to listen to. 'update' events occur after appending values locally, 'apply' events occur when remote changes are synchronized.

spore.commit([[string, string, string | number | boolean]])

Appends new records to the spore.

$id: 100,
name: 'James M.',
phone: '5555555555',
email: '[email protected]',

Websocket API

import * as Websocket from '@mycelial/websocket';
const spore = Mycelial.create('contacts', 123);

const ws = Websocket.create(spore, {
endpoint: 'wss://',

Websocket.create(spore, endpoint)

Creates a websocket adapter that synchronizes the replica across two or more nodes


Apache 2.0