🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@onlyoffice/docspace-plugin-sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onlyoffice/docspace-plugin-sdk

Simple plugin system for onlyoffice docspace

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
172
-33.59%
Maintainers
1
Weekly downloads
 
Created
Source

ONLYOFFICE DocSpace Plugins SDK

Overview

ONLYOFFICE DocSpace Plugins SDK is an npm package based on TypeScript engines which provides interfaces to create your own plugins for embedding in the DocSpace portal.

To install the @onlyoffice/docspace-plugin-sdk npm package globally, run the following command in the terminal:

npm i -g @onlyoffice/docspace-plugin-sdk

Functionality

  • Creating base plugins with the npx command.
  • Embedding plugins in context menu, info panel, profile menu, main button using the corresponding interfaces.
  • Configuring plugin UI using the DocSpace plugins components.

npx

After installing the npm package, the npx create-docspace-plugin command becomes available and allows you to create a plugin template with the pre-installed plugin types and the implementation of basic methods.

This command displays a dialog which allows you to configure the plugin settings and select the required scopes.

You can find a list of all the dialog questions here.

Developing a plugin

  • Write code for each plugin type using the corresponding variables, methods and items. Put the scripts into the src folder. Specify the required Plugin interface for each plugin to be embedded in the portal.
  • Specify plugin messages that will be returned by the items. Use the appropriate events that will be processed on the portal side.
  • Configure the plugin UI using the plugin components.

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

For plugins created with the old template (SDK 1.1.1), replace the build script in package.json with the following:

"build": "webpack && npx build-docspace-plugin"

:::note To ensure the new npx command works correctly, you need to update the globally installed @onlyoffice/docspace-plugin-sdk package to version 2.0.0 or higher. :::

Building a plugin

To build a plugin, you need Node.js and npm to be installed. After that, follow the instructions below:

  • Open the terminal and go to the plugin root folder:
cd PDF-Converter
  • Install all the necessary dependencies (if this was not done previously when creating the plugin template):
npm install
  • Collect an archive for uploading to the portal:
npm run build

This command generates the obfuscated code from the entire project and collects it into the plugin.js file using the webpack npm package.

The dist folder will be created in the root plugin folder and the plugin archive will be placed in it. This archive is the completed plugin that can be uploaded to the DocSpace portal.

The old createZip script is no longer required and can be safely removed.

Keywords

onlyoffice

FAQs

Package last updated on 16 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts