Skip to main content

Installation

  1. To start integrating Ditto into your app you need to download a copy of the libditto.a static library and the Ditto.h header. The following command will download and then unpack an archive containing the library and header.

For linux systems running on Intel-based CPUs with x86_64 architecture.

curl -O https://software.ditto.live/cpp-linux-x86_64/Ditto/4.8.1-rc.1/dist/Ditto.tar.gz && tar xvfz Ditto.tar.gz
  1. Configure your app to link to the Ditto static library. Usually, this will mean adding an -lditto to a compilation step for your app.
  • Assume we have unzipped the Ditto.tar.gz in a relative directory ./sdk/
  • main code entry point is in ./src/main.cpp
  • output will be in ./dist/main
g++ -std=c++17 ./src/main.cpp -I ./sdk -lditto -ldl -lrt -pthread -L ./sdk -o dist/main;

To add Bluetooth Low Energy capabilities please follow the instructions here.

  1. Now, in your C++ code, you can import ditto with: #include <Ditto.h>
auto identity =    Identity::OnlinePlayground("REPLACE_ME_WITH_YOUR_APP_ID",                               "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN", true);try {  Ditto ditto = Ditto(identity, dir);  ditto.set_minimum_log_level(LogLevel::debug);  ditto.start_sync();} catch (const DittoError &err) {}
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.