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. You create and manage your API keys yourself in MoBro:
- Open the settings and turn on Developer options in the General section.
- Log in with your MoBro account.
- Open the Developers page in the User section of the settings and select Create API key.
- Optionally enter a description to tell your keys apart (e.g.
GitHub Actions for my widget pack) and choose when the key expires: never, after 30, 90 or 365 days, or on a custom date. - Copy the key.
The key is only shown once, right after it was created. If you lose it, delete it and create a new one.
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:
MODBROS_MARKETPLACE_API_KEY=your_api_key
Keep the API key secret. Add the .env file to your .gitignore so it isn't committed.
Managing API Keys
Every API key belongs to an author. Your personal author is set up together with your first key. If you're a member of an organization, the Developers page lists it as a separate author with its own keys.
On the Developers page you can also:
- Edit a key to change its description or expiration.
- Disable a key. It stops working immediately, and can be enabled again at any time.
- Delete a key you no longer need. It stops working immediately, and this can't be undone.
- Check the statistics of your published items, such as the total downloads, downloads this week and average rating.
Each author can hold a limited number of API keys at once and publish a limited number of items per type. Both limits are shown on the Developers page. Unpublished items count towards the limit as well. If you need more, reach out to us in the developer channel on our Discord.
Before Publishing
- Test the widget pack in MoBro using
dashboard-cli dev. - Set the version. The version is taken from the
versionin thepackage.json. Increase it for every release. - Complete the widget pack configuration. Fill in the
displayName,author,description,tags,repositoryUrlandhomepageUrlfields in themobro-widget-pack-config.json. - Add a logo and a store page for new widget packs: a
logo.svgorlogo.pngfile and astorepage.mdfile (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.
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.
| Command | Description |
|---|---|
dashboard-cli update-info --api-key xxx | Updates the displayName, author, description, tags, repositoryUrl and homepageUrl from the mobro-widget-pack-config.json. |
dashboard-cli update-logo --api-key xxx | Updates the logo from the logo.svg or logo.png file. |
dashboard-cli update-storepage --api-key xxx | Updates the store page from the storepage.md file. |
All commands of the CLI are described in In-depth: CLI.