---
title: "Publishing Widgets"
description: "Publish your GlassHome widgets to Hub. Login, validate, version, select scope, and publish."
canonical: https://glasshome.app/docs/widgets/widget-publishing
section: "CLI & Publishing"
updated: 2026-10-19
---
# Publishing Widgets

Share your widgets with the GlassHome community by publishing them to Hub.

## Publish Flow

1. **(Optional) Log in to GlassHome Hub** You only need to run this explicitly if you want to authenticate before publishing. The `publish` command auto-runs login if no token is found, so this step is optional in practice.

   ```bash
   bun widget login
   ```

   This runs an OAuth PKCE flow against Hub. A browser opens; the first time, Hub asks you to allow the widget CLI on your account. The callback lands on `http://127.0.0.1:9274/callback`. The resulting token is stored locally, renewed in the background and reused on subsequent publishes for up to 30 days. This is separate from `bun widget connect`, which authenticates against your local Dash instance using a device-code flow.

2. **Validate your widgets** Checks manifests, bundle sizes, and SDK version compatibility. Fix any issues before publishing.

   ```bash
   bun widget validate
   ```

3. **Publish** The CLI validates first, then prompts you to select which widget to publish, choose a scope, and pick a version bump. It then builds and uploads the bundle to Hub, which checks it before it goes live.

   ```bash
   bun widget publish
   ```

   Use flags to skip prompts:

   - `--name <widget>`: publish only the named widget.
   - `--bump keep|patch|minor|major`: pre-pick the version bump. This updates the `version` field in `src/<name>/manifest.json`.
   - `--scope <scope>`: pre-pick the publishing scope.
   - `--lower-floor`: publish at the `sdkVersion` floor derived from your bundle when it is below the one in the manifest. Without the flag, publish stops and names both.

## Publish lifecycle

The gate checks in the diagram above are enforced server-side, with precise failures:

- **Bundle > 2 MB, or stylesheet > 1 MB** → rejected with `400`.
- **A file that is not what it claims** → rejected with `422`: the bundle must parse as a JavaScript module and the stylesheet as CSS, each matching the size and hash the CLI declared.
- **Duplicate version** → `409`; published versions are immutable. A version whose publish never finished can be published again.
- **Scope you don't own** → rejected. Org scopes require the `owner` or `admin` role.
- **A name removed by moderation** → `403`; it stays blocked until I lift the removal.

## Versioning

The `version` field lives in `src/<name>/manifest.json`. The `--bump` flag increments it automatically. Versions follow semver:

- **Patch (0.1.0 → 0.1.1).** Bug fixes, no config changes.
- **Minor (0.1.0 → 0.2.0).** New features, backward-compatible config.
- **Major (0.2.0 → 1.0.0).** Breaking config changes (bump `configVersion` too and add a `migrate` function; see [Config Migrations](/docs/widgets/widget-migrations)).

> **On SDK 1.0:** Widgets must target `@glasshome/widget-sdk` 1.x and declare a `capabilities` block, or publish is rejected. See [Upgrading to SDK 1.0](/docs/widgets/widget-sdk-1-0).

## Publishing Scopes

When you publish, the CLI prompts you to select a publishing scope if you belong to any organizations:

```
? Select publishing scope:
  ❯ @your-username (personal)
    @my-team (organization)
```

Your **personal scope is your username** (`@username`). Organization scope uses the org slug. You can create organizations on [GlassHome Hub](/docs/hub/organizations). The CLI learns which scopes you can publish to from `GET /api/widgets/scopes`, which returns your personal scope plus any org scopes you have permission to publish under.

### How your username is determined

Your username is assigned automatically at signup by slugifying your display name (lowercased, with non-alphanumeric runs collapsed to dashes, so "Alice Test" becomes `alice-test`). It is unique per account: if someone already has that slug, later accounts get a numbered suffix (`alice-test-2`).

The username is decoupled from your display name. Renaming your display name later does **not** change your scope, so widgets you have already published stay reachable at the same `@username/widget-name` ID.

You can change your username in your [account dashboard](/dashboard) settings, but **not while you have widgets published** under your current scope (changing it would orphan them). Yank or remove those widgets first, or publish future versions under a new scope.

`@glasshome` is the reserved official scope and cannot be claimed by users or organizations.

## Unlist a widget

Open your widget in [Your widgets](/dashboard/widgets) and choose **Unlist**. It leaves search, the catalog and its public page, so nobody new can install it. Dashboards that already have it keep their copy. **List again** brings it back. Installing or updating it from the Hub is not possible while it is unlisted, including for you.

## Yank, deprecation, and release notes

The database schema tracks `yanked`, `yankedReason`, `deprecationMessage`, and `releaseNotes` per version. There is no user-facing mechanism to yank or deprecate a version yourself yet. If you publish a broken version and need it pulled, contact me directly and I'll yank it.

`releaseNotes` will be shown in the widget detail view once that UI is built.

## When I restrict a widget

Anyone can report a widget from its page on the Hub. If I unlist, remove or yank one of yours for breaking the [terms](/terms) or the law, after a report or on my own, you get an email (to whoever published it, and for an organization's widget also its owners and admins) saying what I restricted, the facts, the law or section of the terms it rests on, whether a report led to it, how long and where it applies, and how to contest it: reply within six months and I look at it again.

A widget I unlisted stays unlisted until I relist it, even if you delete it and publish it again under the same name; you can still edit its name and description. A widget I removed can't be published again under the same name until I lift the removal. Yanking a version because it's broken (a defect, a bad build, an SDK floor it can't meet) isn't a restriction, so it comes without a statement.

## After Publishing

Your widget appears in the Widget Browser, installable in one click. To ship an update, bump the version and run `publish` again.

If your widget declares `examples`, its preview images are produced for this version and appear on its Hub page and in the Widget Browser. See [Widget Previews](/docs/widgets/widget-previews).

## Trust Badges

- **Official.** Maintained by GlassHome. Installed without a confirmation dialog.
- **Community.** Published by users. Users see a consent dialog before installing.

> **Bundle size:** Keep your widget bundles small. The hard limit is 2 MB (rejected at publish time). The CLI shows bundle sizes during `validate` and `info`. Large bundles slow down dashboard loading for everyone.