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.
- Add the JS package with either npm or yarn.
# using npmnpm install @dittolive/ditto@4.8.1-rc.1 --save
# using yarnyarn add @dittolive/ditto@4.8.1-rc.1
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
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Supported Version 84 and higher | Supported Version 84 and higher | Supported Version 79 and higher | No Support | No Support | Safari 14.1 and higher |
Mobile Browser Support
WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet |
---|---|---|---|---|---|
WebView AndroidFull support84 | Version 84 and Higher | Version 79 and Higher | No Support | iOS Version 14.5 and higher | Version 14.0 and higher |
NodeJS & Electron Support
Depending on your Windows installation, you may need to install Microsoft Visual C++ Redistributable.
NodeJS | Electron | |
---|---|---|
MacOS | ✓ | ✓ |
Linux | ✓ | ✓ |
Windows x64 | alpha | alpha |
Windows x86 (32-bit) | x | x |
Windows IoT | x | x |
Ditto supports Ubuntu 20.04 LTS and above
React Native
React Native | |
---|---|
iOS | In Development |
Android | In 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())