• Public
  • Public/Protected
  • All

Interface IdentitySharedKey

An identity with intermediate level of security where all users and devices are trusted and a single shared secret (key) between all peers satisfies the security requirements.

NOTE: This identity type is only supported for Node environments, using this to create a Ditto instance in the web browser will throw an exception.


  • IdentitySharedKey



Optional appID

appID?: string

The app ID for the Ditto instance. This property is marked optional for backwards compatibility with the now deprecated appName. One of those must be given otherwise Ditto will throw an exception at construction time.

Optional appName

appName?: string


sharedKey: string

A base64 encoded DER representation of a private key, which is shared between devices for a single app.

Optional siteID

siteID?: number | BigInt

The siteID needs to be an unsigned 64 bit integer >= 0, i.e. either a regular non-fractional number or a BigInt in the range between 0 and 2^64 - 1 (inclusive). If siteID is 0, Ditto will generate an appropriate site ID and persist it when needed. Default is 0.


type: "sharedKey"