Initializes a new DittoConfig instance with the new API.
OptionalpersistenceDirectory: stringThe connectivity configuration for this Ditto instance.
Specifies how this instance discovers and connects to peers, including network settings and authentication options.
The unique identifier for the Ditto instance.
This must be a valid UUID string. You can find the ID in the Ditto portal, or provide your own if you only need to sync with a small set of peers.
Note: "Database ID" was referred to as "App ID" in older versions of the SDK.
DEFAULT_DATABASE_ID for the default database ID used when no ID is provided.
OptionalpersistenceThe persistence directory used by Ditto to persist data.
This property can have three types of values:
/Users/joe/some/path/to/my-project.ddb)some/path/to/my-project.ddb)When a relative path is set, it will be resolved relative to
Ditto.DEFAULT_ROOT_DIRECTORY. When this is undefined, Ditto will
use a default directory name of ditto-{id} within
Ditto.DEFAULT_ROOT_DIRECTORY, where {id} is the lowercase version
of the id set in this DittoConfig.
To access the final resolved absolute path after creating a Ditto instance,
use Ditto.absolutePersistenceDirectory. This property will always
return the effective absolute file path being used, regardless of whether
you provided an absolute path, relative path, or undefined.
Note: It is not recommended to directly read from or write to this directory, as its structure and contents are managed by Ditto and may change in future versions.
Note: When Logger is enabled, logs may be written to this directory even after a Ditto instance has been deallocated. Please refer to the documentation of Logger for more information.
Returns true if the receiver has been frozen using freeze().
StaticdefaultReturns a default DittoConfig instance with standard settings.
This is useful as a starting point or for quickly creating a basic configuration, but for production use you should customize the configuration as needed.
StaticDEFAULT_The default database ID, used when no database ID is provided.
database_id for more information about the
databaseID parameter.
Returns a deep copy of the receiver.
The copy is not frozen, so it's properties can be modified.
Warning: This does not create copies of authentication handlers referenced by the identity. Changes inside the authentication handlers will be reflected in the copy.
Deep freezes the receiver such that it can't be modified anymore.
Use copy() to create a copy of the receiver that is not frozen.
Warning: this does not freeze legacy authentication handlers referenced by the identity. Changes inside the authentication handlers will be reflected in the frozen DittoConfig.
A configuration object for initializing a Ditto instance.
Encapsulates all the parameters required to configure a Ditto instance, including identity, connectivity, and persistence.
This API is in preview and will become the standard way to initialize Ditto instances in v5, replacing the legacy Identity-based initialization.