Plugins
TL;DR: in jbrowse-web and jbrowse-desktop, add a plugin by listing its
name (which must match the name the plugin registers itself under) and bundle
url in the top-level plugins array.
Embedded components load plugins inline; see the inline plugins example.
{
"plugins": [
{
"name": "GDC",
"url": "https://unpkg.com/jbrowse-plugin-gdc/dist/jbrowse-plugin-gdc.umd.production.min.js"
}
]
}
The name must match the name the plugin registers itself under in its source
(e.g. name = 'GDC' in the plugin class), or the plugin fails to load. The
url (or one of the location fields below) points at the built plugin bundle.
The plugin store lists unpkg URLs for published plugins, which
you can also download to your own server.
url is the simplest option and is equivalent to umdUrl. Other fields cover
different situations:
| Field | Module format | Path resolved relative to |
|---|---|---|
url | UMD | index.html |
umdUrl | UMD | index.html |
umdLoc | UMD | config.json |
esmUrl | ESM | index.html |
esmLoc | ESM | config.json |
cjsUrl | CJS | index.html (desktop only) |
Which one to reach for:
umdLocoresmLocwhen your plugin file lives alongside your config.jsonesmUrl/esmLocfor a pure ESM modulecjsUrlfor jbrowse-desktop, since Electron does not support ESM and the jbrowse-plugin-template outputs CJS-specific code for desktop
umdLoc example
{
"plugins": [
{
"name": "MyPlugin",
"umdLoc": { "uri": "plugin.js" }
}
]
}
esmUrl example
{
"plugins": [
{
"name": "MyPlugin",
"esmUrl": "https://unpkg.com/my-plugin/dist/index.mjs"
}
]
}
Plugin store
Plugin authors can submit their plugin via PR to jbrowse-plugin-list.
You can verify the plugin is installed properly by checking the Plugin Store:
See our developer guide for developing plugins, or the plugins page for published plugins.