EdgeSync

Getting started

This guide walks through creating a project, writing your first keys and subscribing to changes from a second client.

Install

npm install @edgesync/client

Connect

import { connect } from '@edgesync/client'

const db = await connect({
  project: 'demo-notes',
  token: process.env.EDGESYNC_TOKEN,
})

Write and read

await db.set('notes/42', { title: 'Groceries', done: false })
const note = await db.get('notes/42')

Subscribe

for await (const ev of db.watch('notes/')) {
  console.log(ev.key, ev.op, ev.value)
}
Something unclear? Open a discussion — we answer within one working day.