The official TypeScript SDK for building Beekeeper Studio plugins.
Plugins are small web apps that run inside Beekeeper Studio in a sandboxed <iframe>. The
SDK (@beekeeperstudio/plugin on npm) wraps the postMessage protocol between your plugin
and the app in typed, promise-based functions, so you can read the connected database, run
queries and integrate with the Beekeeper Studio UI.
- Plugin Development Introduction - how plugins work
- Plugin SDK - overview of the SDK and the Vite build plugin
- Creating Your First Plugin - step-by-step tutorial
- SDK Reference - every function, event and type in the SDK
- Plugin Views - the tab types a plugin can open
- Capabilities - every menu and button a plugin can add to
- Manifest Reference - the
manifest.jsonformat - Publishing Plugins - distribute your plugin to other users
- Database metadata - list schemas, tables, columns, primary keys, foreign keys and indexes
(
getSchemas,getTables,getColumns,getTableKeys,getTableIndexes, ...) - Queries - run SQL against the active connection with
runQuery, and show results in Beekeeper Studio's own result table withexpandTableResult - Connection and app info - read connection details, the app version, the theme and
update status (
getConnectionInfo,getAppInfo,getAppVersion,checkForUpdate) - Views and tabs - read how a view was opened, persist per-view state, set the tab title,
open query, table data or table structure tabs and control the status bar (
getViewContext,getViewState,setViewState,setTabTitle,openTab,toggleStatusBarUI, ...) - Storage - persist plugin data, with optional encryption (
appStorage) - App UI - show toast notifications and confirmation dialogs (
noty,confirm) - System integration - clipboard text and images, native save dialogs and opening links
in the browser (
clipboard,requestFileSave,openExternal) - Events - react to theme changes, table changes and window events with
addNotificationListener, and message other views of your plugin withbroadcast - Keyboard and mouse forwarding -
@beekeeperstudio/plugin/dist/eventForwarderpasses app shortcuts and pointer events from your plugin through to Beekeeper Studio - Debugging - log every message with
setDebugComms, and write to the app log withlog - TypeScript types - typed requests, responses and shared models such as
Table,Column,QueryResultand the context menu params
See the SDK Reference for the full list.
npm install @beekeeperstudio/plugin
# or
yarn add @beekeeperstudio/plugin// Forwards keyboard and mouse events to Beekeeper Studio
import "@beekeeperstudio/plugin/dist/eventForwarder";
import { getTables, runQuery } from "@beekeeperstudio/plugin";
// Get all tables in the current database
const tables = await getTables();
// Run a SQL query
const result = await runQuery("SELECT * FROM users LIMIT 10");For a complete walkthrough, follow Creating Your First Plugin.
Use @beekeeperstudio/vite-plugin to build
your plugin with Vite. It adds hot module replacement inside Beekeeper Studio
during development, and rewrites your HTML so the production bundle loads correctly in the app.
npm install --save-dev @beekeeperstudio/vite-plugin
# or
yarn add -D @beekeeperstudio/vite-plugin# Build the library
yarn build
# Generate API docs with TypeDoc
yarn docsMIT