Skip to content

Common API

All modules have the following common API.

init()

Asynchronous method that resolves when the modules finishes its initialization.

Although loadModule returns the module already initialized, this method is maintained for compatibility purposes.

Output:

  • promise (Promise): Promise that is resolved when the module is initialized. The promise returns the module.

Example:

1
2
3
module.init(function(mod) {
    console.log("module initialized");
});

getModuleName()

Returns the name identifier of the module.

Output:

  • name (string): Module name

Example:

1
2
3
4
DVM.loadModule("module_name", {...})
    .then(function(module) {
        console.log(module.getModuleName()) // "module_name"
    });

getModuleVersion()

Returns the module version.

Output:

  • version (string): module version

Example:

var version = module.getModuleVersion();

getPluginsList()

Returns a list with the current plugins in use (if any).

Output:

  • plugins (string[]): Plugins list.

Example:

var list = module.getPluginsList();

getClientId()

Returns the client id used in this instance (if any).

Output:

  • client_id (string | null): client id

Example:

var client_id = module.getClientId();