Skip to content
EN

Plugin structure

Last updated

A Re:Earth Visualizer Plugin is a .zip file containing two types of files: a single reearth.yml configuration file and one or more JavaScript files—one for each extension. The reearth.yml file describes the Plugin and declares its extensions, while each JavaScript file contains the logic for its extension. Together, these files are all Visualizer needs to load and run a Plugin.

Every Plugin must include a file named reearth.yml at the root of the .zip. This YAML file contains Plugin metadata, including its name, version, description, and extensions.

reearth.yml
id: demo-plugin
name: Demo Plugin
version: 1.0.0
extensions:
- id: demo-widget
type: widget
name: Demo Widget

For the complete list of supported fields, see the Plugin manifest schema.

Each extension declared in reearth.yml must have a corresponding JavaScript file. The filename must match the extension id. For example, an extension with id: demo-widget requires a file named demo-widget.js.

The JavaScript file contains the logic for that extension. It runs on the WebAssembly side and has full access to the globally exposed Plugin API.

demo-widget.js
reearth.ui.show(`<h1>Hello, World!</h1>`);

Once reearth.yml and all extension JavaScript files are ready, compress them together into a single .zip file. You can install that .zip into any Re:Earth Visualizer project.

my-plugin.zip
├── reearth.yml
└── demo-widget.js

If your Plugin has more than one extension, include a JavaScript file for each one:

my-plugin.zip
├── reearth.yml
├── demo-widget.js
└── demo-infobox-block.js

For a faster development experience that avoids the cycle of building and installing the .zip, see Set up a local development environment.