Skip to main content

Publish and Install

So far, we've run the widget pack locally using dashboard-cli dev. Once your widgets work as intended, publish the widget pack to the marketplace so everyone can install it.

API Key

Publishing to the marketplace requires an API key.
There is currently no user interface to obtain an API key or to manage your widget packs.

To request an API key, reach out to us in the developer channel on our Discord. We'll provide you with a key and help with publishing your first widget pack if needed.

Instead of passing the API key to every command using --api-key, you can define it in a .env file in the root directory of the project:

.env
MODBROS_MARKETPLACE_API_KEY=your_api_key
caution

Keep the API key secret. Add the .env file to your .gitignore so it isn't committed.

Before Publishing

  • Test the widget pack in MoBro using dashboard-cli dev.
  • Set the version. The version is taken from the version in the package.json. Increase it for every release.
  • Complete the widget pack configuration. Fill in the displayName, author, description, tags, repositoryUrl and homepageUrl fields in the mobro-widget-pack-config.json.
  • Add a logo and a store page for new widget packs: a logo.svg or logo.png file and a storepage.md file (Markdown) in the root directory of the project.

Publishing

Run the following command in the root directory of the project:

dashboard-cli publish --api-key your_api_key

The CLI validates the configuration files and asks for confirmation. It then bundles the src/ directory, the mobro-widget-pack-config.json and the package.json into a .zip file in the dist/ directory, and uploads it as a new version to the marketplace.

If the widget pack doesn't exist in the marketplace yet (based on its name), the CLI asks whether to create it. After uploading the version, the CLI then sets the logo and store page from the logo.svg or logo.png and storepage.md files, and publishes the widget pack.

Once published, open the marketplace in MoBro, search for your widget pack and install it.

note

Only the src/ directory, the mobro-widget-pack-config.json and the package.json are published. MoBro compiles the widget pack on the PC of every user who installs it.

Publishing a New Version

To publish a new version, increase the version in the package.json and run the publish command again.

Each version can only be published once. To replace the content of an already published version, use the --update option:

dashboard-cli publish --api-key your_api_key --update

SDK Version

The minimum version of @modbros/dashboard-sdk in the dependencies of the package.json is stored as the minimum SDK version of the release (e.g. 1.4.0 for ^1.4.2). MoBro installations providing an older SDK can't install the release.

Only raise the SDK version when you need its features, so the release stays compatible with older MoBro installations.

Updating the Listing

The following commands update the listing of a widget pack that is already published. The widget pack is identified by the name in the mobro-widget-pack-config.json.

CommandDescription
dashboard-cli update-info --api-key xxxUpdates the displayName, author, description, tags, repositoryUrl and homepageUrl from the mobro-widget-pack-config.json.
dashboard-cli update-logo --api-key xxxUpdates the logo from the logo.svg or logo.png file.
dashboard-cli update-storepage --api-key xxxUpdates the store page from the storepage.md file.

All commands of the CLI are described in In-depth: CLI.