Skip to main content


Ditto's JavaScript SDK can run either in the browser, NodeJS, or Electron environments. React Native support is currently under development. For more information about browser, NodeJS and Electron support click here.

  1. Add the JS package with either npm or yarn.
# using npmnpm install @dittolive/ditto@1.1.9 --save
# using yarnyarn add @dittolive/ditto@1.1.9
npm install --save @dittolive/ditto# or with yarnyarn add @dittolive/ditto
  1. Import it like any other NPM package in your source and start using it:
import { init, Ditto } from "@dittolive/ditto"(async () => {  await init() // you need to call this at least once before using any of the Ditto APIconst identity: Identity = { type: 'onlinePlaygroundV2', appID: 'REPLACE_ME_WITH_YOUR_APP_ID', token: 'REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN' }const ditto = new Ditto(identity, path)ditto.tryStartSync()})()

Need to run NodeJS on a Linux or Raspberry Pi? Make sure to read this.