Skip to main content

Initialize Plugin

The DytePlugin class is the root class of Plugin SDK. It is the main entry point of the SDK. It is the only class that you need to instantiate in order to use the SDK.

A plugin object can be created using DytePlugin.init() method. The init() method can take an optional config object.

tip

Do checkout “Guides” for end to end examples on the usage of these modules.

The following is the schema for the config object :

ParamTypeDescriptionDefault ValueRequired
authTokenstringAuthorisation token.auto-filled by client SDK.false
baseURLstringServer URL being used by the parent app.auto-filled by client SDK.false
parentURLstringURL of the parent app the plugin is opened in.auto-filled by client SDK.false
pluginIdstringID generated using Dyte CLI.auto-filled by client SDK.false
readybooleantrue when the plugin initialization has completed.truefalse
import DytePlugin from "@dytesdk/plugin-sdk";
...
const plugin = DytePlugin.init();
await plugin.stores.populate('storeName');