website logo
Legacy DocsPortal
⌘K
Welcome to Ditto
Onboarding
Ditto Basics
SDK Setup Guides
Platform Manual
HTTP API
Kafka Connector
Use Cases
FAQs
Troubleshooting Guide
Support
Docs powered by
Archbee
SDK Setup Guides
C#

Quickstart

5min

This quickstart provides step-by-step instructions on installing and setting up the Ditto SDK in your .NET C# project.

To integrate Ditto with your app and start syncing:

  1. Install the Ditto SDK in your project. (Installing Ditto)
  2. Using the Ditto SDK, initiate data sync in your app. (Initializing Ditto)

Installing Ditto

Using either a compatible package manager, the .NET CLI, or by adding a reference to the package: CSProj.xml file, install the Ditto SDK by doing any of the following:

If using a package manager other than NuGet, the official package manager for .NET, the command syntax to install Ditto may differ from the following snippet. For more information, see the official Nuget documentation > Ditto .NET Standard

Package Manager
.NET CLI
Package Reference
|
Install-Package Ditto -Version 4.3.0


Initializing Ditto

Once you’ve installed the Ditto SDK, set the debug level you want Ditto to log messages for, create a new Ditto identity, and set up Ditto exception handling for data sync operations:

C#
|
try
{
    DittoLogger.SetMinimumLogLevel(DittoLogLevel.Debug);
    var ditto = new Ditto(DittoIdentity.OnlinePlayground("REPLACE_ME_WITH_YOUR_APP_ID", "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN", true), path);
    ditto.StartSync();
}
catch (DittoException ex)
{
    Console.WriteLine($"Ditto Error {ex.Message}");
}




Updated 27 Sep 2023
Did this page help you?
PREVIOUS
Installing C# SDK
NEXT
Compatibility with C#
Docs powered by
Archbee
TABLE OF CONTENTS
Installing Ditto
Initializing Ditto
Docs powered by
Archbee