npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beamable/portal-toolkit

v0.1.6

Published

Beamable Portal Toolkit — utilities and web component types for the Beamable portal plugin system

Readme

@beamable/portal-toolkit

Utilities and type definitions for building Beamable portal extensions.

  • Portal.registerExtension() — registers your extension with the portal host
  • TypeScript types for all Beamable web components (beam-btn, beam-data-table, etc.)
  • Svelte element types for .svelte template autocomplete
  • Re-exports of @beamable/sdk types

Installation

npm install @beamable/portal-toolkit
# @beamable/sdk is a peer dependency — install it too
npm install @beamable/sdk

Because @beamable/sdk is injected as a global by the portal host at runtime, mark it external in your bundler:

// vite.config.ts
export default {
  build: {
    rollupOptions: {
      external: ['@beamable/sdk'],
    },
  },
};

Usage

Registering an extension

import { Portal } from '@beamable/portal-toolkit';

Portal.registerExtension({
  beamId: 'MyExtension',
  onMount(container, context) {
    // context.beam   — Promise<Beam> — the Beamable SDK instance
    // context.cid    — customer ID
    // context.realm  — realm string (cid.pid)
    container.innerHTML = `<p>Hello from ${context.realm}</p>`;
    return container; // returned value is passed to onUnmount
  },
  onUnmount(instance) {
    // tear down your UI
  },
});

Svelte autocomplete

Add one line to your project's app.d.ts:

/// <reference types="@beamable/portal-toolkit/svelte" />

This gives .svelte templates full autocomplete for all beam-* components.


Development

Syncing web components from agentic-portal

The custom element definitions live in the agentic-portal repo. When that repo adds or changes components, pull them into this package:

# 1. In the agentic-portal repo, regenerate its CEM:
cd ../../agentic-portal && npm run generate:cem

# 2. Back in this repo, copy the CEM and regenerate all type files:
cd -
pnpm sync-components

By default the sync script expects agentic-portal to be a sibling directory:

~/Documents/Github/
  BeamableProduct/   ← this repo
  agentic-portal/    ← agentic-portal repo

Override the path if yours is elsewhere:

PORTAL_REPO_PATH=/path/to/agentic-portal pnpm sync-components

This regenerates:

  • custom-elements.json — CEM manifest (VS Code HTML IntelliSense)
  • src/generated/globals.tsHTMLElementTagNameMap augmentations
  • src/generated/svelte-elements.tsSvelteHTMLElements augmentations
  • src/generated/web-types.json — JetBrains/WebStorm autocomplete

Commit all generated files after syncing.

Building locally

pnpm install
pnpm build

prepublishOnly runs sync-components --no-copy && build automatically before publish, so the generated files are always up to date without re-copying from agentic-portal.


Releasing a new version

Step 1 — Sync components (if agentic-portal changed)

If the agentic-portal repo has new or updated components since the last release, run:

cd ../../agentic-portal && npm run generate:cem && cd -
pnpm sync-components

Review the diff, then commit.

Step 2 — Update the portal repo version mapping

This step is required. The portal host uses a version map to know which toolkit version to load for a given extension. Without this update, extensions referencing the new version will fail to load.

In the agentic-portal repo, update the version mapping file (ask the portal team for the exact location if unsure) to add an entry for the new toolkit version.

Step 3 — Trigger the GitHub Action

Go to Actions → Portal Toolkit Release and click Run workflow. Fill in:

| Field | Notes | |---|---| | major / minor / patch | The new semver components | | releaseType | production for a stable release, rc for a release candidate, nightly/exp for pre-release | | rcNumber | Only needed when releaseType is rc | | dryRun | Set true to verify the build without publishing |

The workflow will:

  1. Check out the repo at the specified commit
  2. Set the package version from the inputs
  3. Run prepublishOnly (sync + build)
  4. Publish to npm with provenance attestation

Version format

| releaseType | npm tag | Version example | |---|---|---| | production | latest | 1.2.3 | | rc | rc | 1.2.3-rc.1 | | nightly | nightly | 1.2.3-nightly | | exp | exp | 1.2.3-exp |

Manual publish (first-time or emergency)

cd beam-portal-toolkit
nvm use 22.14.0 && corepack enable
pnpm install
# optionally bump version first:
# npm version 0.2.0 --no-git-tag-version
pnpm publish --access public

You must be logged in to npm (npm login) with publish rights to the @beamable org and have an automation token configured (see npm → Access Tokens → Granular Access Token with "bypass 2FA").


Package exports

| Import path | Contents | |---|---| | @beamable/portal-toolkit | Portal namespace, all @beamable/sdk types, web component globals | | @beamable/portal-toolkit/svelte | SvelteHTMLElements augmentations (triple-slash reference only) | | @beamable/portal-toolkit/custom-elements.json | CEM manifest | | @beamable/portal-toolkit/web-types.json | JetBrains web-types |