
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
@voiden/sdk
Advanced tools
Official SDK for building Voiden extensions with support for both UI (renderer process) and Electron (main process).
Voiden is an extensible, privacy-focused editor built on Electron and Tiptap. The Voiden SDK enables developers to create powerful extensions that enhance the editor's functionality, from custom blocks and slash commands to system-level integrations.
npm install @voiden/sdk
# or
yarn add @voiden/sdk
For UI extensions, you'll also need to install the required peer dependencies:
npm install react react-dom @tiptap/core @tiptap/pm @tiptap/react
Create your first extension in minutes:
import { UIExtension } from '@voiden/sdk/ui';
export class MyExtension extends UIExtension {
name = 'my-first-extension';
version = '1.0.0';
description = 'My first Voiden extension';
async onLoad() {
this.registerSlashCommand({
name: 'greet',
label: 'Say Hello',
slash: '/hello',
description: 'Insert a greeting',
action: (editor) => {
editor.commands.insertContent('Hello from my extension!');
},
});
}
}
The SDK is divided into three parts:
@voiden/sdk/ui) - Run in the renderer process, handle editor blocks, UI components@voiden/sdk/electron) - Run in the main process, handle IPC, file system, native APIs@voiden/sdk/shared) - Shared types and utilitiesimport { UIExtension } from '@voiden/sdk/ui';
import { MyCustomNode } from './nodes/MyCustomNode';
export class MyUIExtension extends UIExtension {
name = 'my-ui-extension';
version = '1.0.0';
description = 'My awesome UI extension';
async onLoad() {
// Register a custom block
this.registerBlock({
name: 'my-custom-block',
label: 'My Custom Block',
node: MyCustomNode,
icon: 'box',
});
// Register a slash command
this.registerSlashCommand({
name: 'insert-custom',
label: 'Custom Block',
slash: '/custom',
description: 'Insert a custom block',
action: (editor) => {
editor.commands.insertContent({ type: 'my-custom-block' });
},
});
// Register a sidebar
this.registerSidebar('right', {
id: 'my-sidebar',
title: 'My Sidebar',
component: MySidebarComponent,
});
}
}
import { ElectronExtension } from '@voiden/sdk/electron';
export class MyElectronExtension extends ElectronExtension {
name = 'my-electron-extension';
version = '1.0.0';
description = 'My awesome Electron extension';
async onLoad() {
// Register IPC handler
this.registerIPCHandler('my-channel', async (data) => {
const result = await this.processData(data);
return { success: true, result };
});
// Register custom protocol
this.registerProtocol({
scheme: 'myapp',
handler: async (url) => {
return { data: 'Custom protocol response' };
},
});
// Watch file system
this.watchFileSystem({
path: '/path/to/watch',
onChange: (event, path) => {
},
});
}
private async processData(data: any) {
// Custom processing logic
return data;
}
}
Many extensions need both UI and Electron components:
// index.ts
import { MyUIExtension } from './ui';
import { MyElectronExtension } from './electron';
export const ui = new MyUIExtension();
export const electron = new MyElectronExtension();
registerBlock(block: BlockDefinition) - Register a Tiptap node as a custom blockregisterSlashCommand(command: SlashCommandDefinition) - Register a slash commandregisterSlashGroup(group: SlashCommandGroup) - Register a group of slash commandsregisterSidebar(side: 'left' | 'right', tab: TabDefinition) - Register a sidebar tabregisterPanel(panel: PanelDefinition) - Register a bottom panelshowModal(modal: ModalDefinition) - Show a modal dialogshowToast(message: string, type?: 'info' | 'success' | 'error') - Show a toast notificationgetEditor(type?: 'main' | 'note') - Get the active editor instancestorage - Extension-scoped persistent storagepipeline - Hook into request/response lifecycleenvironment - Secure environment variable accesshelpers - Access helpers from other extensionsregisterIPCHandler(channel: string, handler: Function) - Register an IPC message handlersendToRenderer(channel: string, data: any) - Send message to renderer processregisterMenuItem(menu: string, item: MenuItemDefinition) - Register a menu itemregisterProtocol(handler: ProtocolHandler) - Register custom URL protocol handlerwatchFileSystem(watcher: FSWatcherDefinition) - Watch file system changesspawn(command: string, args: string[]) - Spawn a child processexec(command: string) - Execute a shell commandstorage - Extension-scoped persistent storageapp - Access to Electron app instancemainWindow - Access to main BrowserWindowAll shared types and utilities are available from @voiden/sdk/shared.
For complete API documentation with detailed examples, see the TypeScript definitions or check out our examples.
The examples directory contains complete, working examples:
Each example is a standalone project you can use as a template:
cd examples/hello-world
npm install
npm run build
Then copy the built extension to your Voiden extensions directory.
TypeScript errors about missing types
npm install react react-dom @tiptap/core @tiptap/pm @tiptap/reacttsconfig.json includes "moduleResolution": "node"Extension not loading in Voiden
IPC handlers not receiving messages
await when sending IPC messages that expect responsesBuild errors
npm run typecheck to see detailed TypeScript errorsdist folder and rebuild: rm -rf dist && npm run buildWe welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone https://github.com/VoidenHQ/sdk.git
cd sdk
# Install dependencies
npm install
# Build the SDK
npm run build
# Watch mode for development
npm run dev
# Type checking
npm run typecheck
Found a security vulnerability? Please see our Security Policy for reporting instructions.
MIT - see LICENSE file for details.
Built with ❤️ by the Voiden team
FAQs
SDK for building Voiden extensions
The npm package @voiden/sdk receives a total of 178 weekly downloads. As such, @voiden/sdk popularity was classified as not popular.
We found that @voiden/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.