Get Started
Plugins
Macros
More information

Getting started with plugins

Here are some fundamental concepts for building plugins step by step:

  1. Coding
  2. Adjusting the plugin style
  3. Localizing
  4. Preparing the plugin for publication
  5. Testing
  6. Publishing

Step 1. Coding

Create a plugin folder with the following files: config.json, index.html, pluginCode.js.

Structure

Use plugin methods and events while writing the plugin code.

Step 2. Adjusting the plugin style

Add the ONLYOFFICE style sheet to the index.html file to adjust your plugin to the ONLYOFFICE editor style:

<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
Controls

Step 3. Localizing

Create the translations folder in the plugin directory with .json files for each language you want to add the translation for. Follow the instructions here to localize and apply the translations.

Step 4. Preparing the plugin for publication

  1. Create an informative About window for your plugin. Add a short description and the plugin version, the company developer name and link to its website. Follow the instructions here to create an About variation in the config.json file.
  2. About window
  3. Prepare icons for the plugin and put them into the main plugin folder. Follow the instructions here to specify icon parameters in the config.json file.

  4. Don’t forget about the readme file where you can add a detailed plugin description, installation and usage instructions, known issues, etc. Put this file into the main plugin folder.

Step 5. Testing

Put all the prepared files to the plugin folder. That’s it! Now you can connect it to the desktop, on-premises or cloud versions of ONLYOFFICE editors and test.

Hello world gif

Step 6. Publishing

If you want your plugin to be available to other users on ONLYOFFICE App Directory, suggest it for publishing by contacting us at marketing@onlyoffice.com.


Code samples are available at https://github.com/ONLYOFFICE/sdkjs-plugins.

If you are looking for ready-to-use plugins, please visit ONLYOFFICE App Directory.