The plugin's folder
The files of a plugin, and the sdeck field in package.json.
| File | What it is for |
|---|---|
package.json | The name (also the plugin's id), version, and the sdeck field that makes it a plugin. |
src/index.tsx | The plugin: its actions, settings, live values and triggers. |
tsconfig.json | For your editor. |
README.md | Shown on npm. |
The sdeck field says which plugin API it targets and where it starts:
{
"name": "sdeck-plugin-weather",
"version": "0.1.0",
"type": "module",
"keywords": ["sdeck-plugin"],
"sdeck": {
"apiVersion": 5,
"entry": "./src/index.tsx",
"icon": "lucide/cloud-sun",
"permissions": ["network"]
}
}icon is what Studio shows beside the plugin's name. It is <pack>/<name>, for any icon in Studio's
icon picker: bs/BsDiscord, si/SiSpotify, lucide/cloud-sun. Add #rrggbb to give it a color
(si/SiSpotify#1ed760); otherwise it has the color of the text around it, which suits light and
dark. Without an icon, Studio shows the first letter of the name.
permissions repeats what the code asks for, so that people see it before they install the plugin. The
reference has every field.
react, @sdeck/plugin, @sdeck/app, @sdeck/core, @sdeck/engine and @sdeck/schema come
from sdeck itself. List them as peer dependencies, never bundle them: a second copy of React
would break hooks. Anything else (an API client, a parser) is an ordinary dependency. sdeck bundles
the plugin and its dependencies when it loads them.