NarraLeaf

Plugin

Extend NarraLeaf Studio and the games it builds with installable plugins.

A plugin is a folder with a manifest.json and one or two prebundled entry files. It can add editor panels, actions, keybindings, blueprint nodes, widgets, and language packs to Studio, and ship game-side code that runs inside the games you build.

Plugins have two entry targets, and a plugin declares one or both:

TargetRuns inAPIUse it for
studioThe editor (workspace window)narraleaf-studio/pluginPanels, actions, keybindings, blueprint node editor metadata, widgets, language packs
runtimeThe game (Dev Mode, Preview, Production)narraleaf-studio/runtimeBlueprint node execution, widget rendering, game-side logic

A blueprint node needs both targets to work in a shipped game: the studio entry registers its editor metadata and the runtime entry registers the code that runs when the game plays it. You write the definition once in a shared module and register it from each entry — see Make a plugin.

Capabilities are declared, not discovered

Anything a plugin's game-side code can reach beyond registering nodes and widgets — storage, story variables, saves, an overlay, a native child process — must be declared in contributes. Studio derives the install permission prompt from that declaration, and an undeclared capability is absent from the API object rather than a call that fails. Read the capability model before writing a runtime entry; it is the one thing that shapes everything else.

The API is types-only

narraleaf-studio is a types-only package. It ships declarations for narraleaf-studio/plugin and narraleaf-studio/runtime; the implementation comes from Studio at load time. Add it as a dev dependency and mark both specifiers external in your bundler (the template does this for you).

yarn add -D narraleaf-studio

Plugins are not sandboxed. An installed plugin runs with the same access as Studio itself, and its game-side code runs on players' machines. Install plugins you trust. Studio shows a permission prompt on install for anything a plugin declares beyond the default surface.

On this page