Skip to main content

Installation

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 see below.

  1. Add the JS package with either npm or yarn.
# using npmnpm install @dittolive/ditto@4.4.5 --save
# using yarnyarn add @dittolive/ditto@4.4.5
npm install --save @dittolive/ditto# or with yarnyarn add @dittolive/ditto

Compatibility

info

Supported on LTS versions of Node.js.

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

Desktop Browser Support

ChromeEdgeFirefoxInternet ExplorerOperaSafari
Supported Version 84 and higherSupported Version 84 and higherSupported Version 79 and higherNo SupportNo SupportSafari 14.1 and higher

Mobile Browser Support

WebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on iOSSamsung Internet
WebView AndroidFull support84Version 84 and HigherVersion 79 and HigherNo SupportiOS Version 14.5 and higherVersion 14.0 and higher

NodeJS & Electron Support

Depending on your Windows installation, you may need to install Microsoft Visual C++ Redistributable.

NodeJSElectron
MacOS
Linux
Windows x64alphaalpha
Windows x86 (32-bit)xx
Windows IoTxx

Ditto supports Ubuntu 20.04 LTS and above

React Native

React Native
iOSIn Development
AndroidIn Development

Svelte

If you are using Svelte, remember to keep your Ditto instance and subscriptions alive for the duration of the program by using writable:

import { writable } from "svelte/store";
let ditto = writable([]);let subscription = writable([]);
ditto.set(new Ditto(identity))subscription.set($ditto.store.collections("cars").find("color == 'red'").subscribe())
New and Improved Docs

Ditto has a new documentation site at https://docs.ditto.live. This legacy site is preserved for historical reference, but its content is not guaranteed to be up to date or accurate.