Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Guides

Publish a Blocklet


Once your Blocklet is developed and tested, the next step is to publish it to a Blocklet Store, making it available for others to install and use. This guide walks you through the three primary steps for publishing: bundling your project, connecting to a store, and uploading the final package.

The overall publishing workflow can be visualized as follows:

Publishing

Preparation

Local Development

.blocklet/release/blocklet.json

Authenticates with Store

Saves Access Token Locally

Uploads Package to Store

Blocklet Project Source Code

blocklet bundle

Bundled Blocklet Package

Developer

blocklet connect

CLI Configured

blocklet upload

Published Blocklet in Store


Step 1: Bundle Your Blocklet#

Before you can upload your Blocklet, you must package it into a distributable format. The blocklet bundle command handles this by compiling your assets and metadata into a standardized structure.

From your project's root directory, run:

blocklet bundle

This command reads your blocklet.yml file and creates a .blocklet/release directory. Inside, you will find a blocklet.json metadata file and a compressed tarball of your project. The command automatically selects the appropriate bundling mode (e.g., zip, simple, compact) based on your Blocklet's configuration.

For a more detailed explanation of bundling modes and options, see the Bundling concept guide and the blocklet bundle command reference.

Step 2: Connect to a Blocklet Store#

To upload a Blocklet, your CLI must be authenticated with a target Blocklet Store. This is a one-time setup (per profile) that securely links your developer identity to the CLI.

Use the blocklet connect command with the URL of the store you wish to publish to:

blocklet connect https://store.blocklet.dev

This command will:

  1. Prompt you to open a web browser to complete the connection using DID Connect.
  2. After successful authentication, it securely stores your access token, developer DID, and store URL in your local CLI configuration.

If you have previously connected to a different store, the CLI will ask for confirmation before overwriting the existing configuration. You can manage multiple configurations using profiles.

Parameter

Description

store

The URL of the Blocklet Store you want to connect to.

--profile

An optional name for the configuration profile. Defaults to default.

For more details, refer to the blocklet connect command reference.

Step 3: Upload the Blocklet#

With your Blocklet bundled and your CLI connected to the store, you are ready to upload.

The blocklet upload command sends your packaged Blocklet to the configured store.

blocklet upload

By default, the command looks for the blocklet.json manifest in the .blocklet/release/ directory. It then reads your saved access token from the configuration to authenticate the request.

Parameter

Description

metaFile

Optional. The path to the blocklet.json file. If not provided, it defaults to .blocklet/release/blocklet.json.

--accessToken

Optional. An access token to use for this specific upload, overriding the one in your configuration.

--profile

Optional. Specifies which configuration profile to use for the store URL and access token.

Upon a successful upload, you will see a confirmation message. Note that some stores may require an additional manual publishing step in the developer dashboard to make the Blocklet publicly visible.

Blocklet MyAwesomeBlocklet 1.0.0 successfully uploaded to https://store.blocklet.dev!
Tips: You need to publish the blocklet at https://store.blocklet.dev/developer/blocklets to make it public accessible

For more details on the upload process, see the blocklet upload command reference.


Congratulations! You have successfully published your Blocklet. The next step could be to learn how to manage dependencies by using other Blocklets as components in your project. See our guide on how to Compose Components.