Skip to main content

Plugins

The plugins section defines the runtime plugin parameters.

autostart

type: string[]

The plugin identifiers from the config.json file that automatically start when the editor opens. The plugins run sequentially in the listed order.

Example: ["asc.{7327FC95-16DA-41D9-9AF2-0E7F449F6800}"]

options

type: object

The external configuration settings for plugins. Settings can target all plugins or a specific plugin — for example, passing an authorization token.

note

You can also use the SetPluginsOptions method of the Automation API to pass this object to the plugin.

Example:

{
"all": {},
"pluginGuid": {}
}

options.all

type: object

The parameters applied to all plugins.

Example:

{
"all": {
"keyAll": "valueAll"
}
}

options.pluginGuid

type: object

The parameters for a specific plugin, identified by its GUID in the asc.{UUID} format.

Example:

{
"asc.{38E022EA-AD92-45FC-B22B-49DF39746DB4}": {
"keyYoutube": "valueYoutube"
}
}

pluginsData

type: string[]

The absolute URLs to the plugin config.json files.

Example: ["https://example.com/plugins/chess-plugin/config.json"]

PluginsPlugins

Plugin command logging

To enable logging of plugin commands in the browser console, set the asc_plugin_commands_log key in the browser's local storage to "true":

localStorage.setItem("asc_plugin_commands_log", "true");

To disable logging, remove the key or set it to any other value:

localStorage.removeItem("asc_plugin_commands_log");

Example

const config = {
// ...
editorConfig: {
// ...
plugins: {
autostart: [
"asc.{7327FC95-16DA-41D9-9AF2-0E7F449F6800}",
],
options: {
"all": {
keyAll: "valueAll",
},
"asc.{38E022EA-AD92-45FC-B22B-49DF39746DB4}": {
keyYoutube: "valueYoutube",
},
},
pluginsData: [
"https://example.com/plugins/chess-plugin/config.json",
],
},
},
};

const docEditor = new DocsAPI.DocEditor("placeholder", config);

The example.com is the name of the server where document manager and document storage service are installed and the plugins are placed. See the How it works section to find out more on ONLYOFFICE Docs service client-server interactions.