Global Key-Value Store.beta


gokv allows for real-time syncing of documents, making it a powerful tool for building collaborative applications.

When a document is synced, it becomes a Proxy object that can be manipulated like a standard JavaScript object. Any updates made to the object are automatically saved and broadcasted to other sessions in real-time."


import gokv, {
} from "";

// Initialize a co-document, needs to specify an unique document ID.
const doc = gokv.Document<{ foo: string }>("DOC_ID");

// Sync the document, changes will be broadcasted to other sessions and saved automatically.
const obj = await doc.sync({ initial: { foo: "bar" } });

// Subscribe the document changes
subscribe(obj, () => {
  console.log(; // "baz"

// Update the document = "baz";

// Get the document snapshot
snapshot(obj); // { foo: "baz" }