Publish
Publish your extension to the Fleetbase Extension Registry using `flb publish` — runs `npm publish` against the configured registry.
flb publish
Publish your extension to the Fleetbase Extension Registry. Under the hood this runs npm publish against the registry. Both an npm package (package.json) and a Composer package (composer.json) are typically published — but flb publish handles them via the same npm publish mechanism (the CLI auto-converts composer.json into a temporary package.json for the API side).
flb publish # Publish from current directory
flb publish ./api # Publish from a subdirectoryOptions
| Option | Description |
|---|---|
[packagePath] | Path of the package to publish (default: current directory) |
-r, --registry <url> | Registry URL (default: https://registry.fleetbase.io) |
Prerequisites
Before publishing you need to be logged in. The CLI checks npm whoami --registry <url>; if it fails, the command aborts:
You must be logged in to publish. Run `npm adduser`.Set up auth with one of:
flb login— username + passwordflb set-auth <token>afterflb generate-token— recommended for CI
Examples
Publish the addon (npm package)
From the addon root (where package.json lives):
flb publishPublish the API (composer package via npm)
From the API root (where composer.json lives):
flb publish ./apiWhen publishing from a directory that has composer.json but no package.json, the CLI:
- Converts
composer.jsonto a syntheticpackage.jsonwithfleetbase.from-composer = true - Runs
npm publish - Removes the synthetic
package.jsonafterwards
This lets the same npm publish flow ship Composer packages too.
Publish to a self-hosted registry
flb publish --registry https://registry.mycompany.comTypical Publish Workflow
# 1. Make sure your local checkout is clean and tests pass
git status
pnpm test
# 2. Bump the version in all three manifests
flb version-bump --minor
# 3. Commit and tag
git add extension.json package.json composer.json
git commit -m "Release v1.3.0"
git tag v1.3.0
# 4. Publish
flb publish
# 5. Push
git push origin main --tagsIf your extension has both an addon and API package, repeat step 4 for each:
flb publish ./addon # or run from the addon directory
flb publish ./api # or run from the api directoryCI / Automated Publishing
For CI, use a token-based auth flow:
# .github/workflows/publish.yml (excerpt)
- name: Configure auth
run: |
echo "//registry.fleetbase.io/:_authToken=${FLEETBASE_TOKEN}" > ~/.npmrc
env:
FLEETBASE_TOKEN: ${{ secrets.FLEETBASE_TOKEN }}
- name: Publish
run: flb publishGenerate the token once with flb generate-token and store it as a CI secret.
Difference from flb bundle-upload
flb publishuses the npm publish flow — the canonical path for distribution. The package becomes installable viaflb install fleetbase/<slug>.flb bundle-uploadships a pre-built.tar.gzto the registry's bundle storage. Useful for distribution channels that don't pull from npm.
Most extensions use flb publish as their primary distribution method.
Troubleshooting
You must be logged in to publish. Run npm adduser. — set up auth via flb login or write a token into ~/.npmrc.
Error: 403 Forbidden — your account doesn't have permission to publish under the package's scope/name. Either you don't own the scope or the version already exists.
Error: 409 Conflict — the version you're trying to publish already exists. Bump with flb version-bump --patch first.
Next
flb unpublish— remove a published versionflb version-bump— bump versions before re-publishing