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

@zeloscloud/app-extension-sdk

v0.1.0

Published

Typed bridge and React hooks for Zelos app-hosted extensions

Readme

App Extension SDK

@zeloscloud/app-extension-sdk is the typed bridge package for Zelos app-hosted extensions.

It provides:

  • connectBridgeTransport() for embedded or standalone bridge setup
  • MockBridge for standalone development and tests
  • React helpers under @zeloscloud/app-extension-sdk/react

Install

npm install @zeloscloud/app-extension-sdk

React is an optional peer dependency. The root entry works without React, and the ./react entry adds the provider and hooks.

Quick Start

Use connectBridgeTransport() to connect to the host bridge. When your extension is running inside Zelos, the bridge connects to the Zelos app. When you open the same extension in a normal browser tab during local development, it automatically falls back to MockBridge.

import { connectBridgeTransport } from "@zeloscloud/app-extension-sdk";

const bridge = await connectBridgeTransport();
const snapshot = bridge.getSnapshot();

console.log(snapshot.info.name, snapshot.theme.preference);

const offTheme = bridge.on("theme.changed", (nextTheme) => {
  console.log("Theme updated:", nextTheme.preference);
});

window.addEventListener("beforeunload", () => {
  offTheme();
  bridge.destroy();
});

Bridge Model

The v1 bridge is intentionally small:

  • the host replies to the initial handshake with handshake-ack.snapshot
  • the snapshot contains info, theme (including design tokens), and workspace
  • after connect, the host only pushes theme.changed and workspace.changed
  • there is no request/response or host-command API in v1
  • embedded extensions cannot make external network requests (connect-src, form-action restricted by CSP); standalone mode via MockBridge has no such restriction

MockBridge

MockBridge is useful when you want to run the extension outside the desktop app or write focused tests around theme and workspace behavior.

import { MockBridge } from "@zeloscloud/app-extension-sdk";

const bridge = MockBridge.connect(
  {
    currentWindow: window,
    parentWindow: window,
    locationHref: window.location.href,
    matchMedia: window.matchMedia.bind(window),
  },
  {
    extensionId: "local.dev-extension",
    version: "0.1.0",
    name: "Development Extension",
  },
);

bridge.setThemePreference("DARK");

React

The React entrypoint wraps bridge setup and exposes the current extension, theme, and workspace snapshots through hooks.

ZelosBridgeProvider also applies Zelos light/dark theme classes and a minimal set of design tokens to the iframe document automatically, so starter extensions can match the host app without reimplementing the theme system.

import {
  ZelosBridgeProvider,
  useExtensionInfo,
  useTheme,
  useZelosBridge,
} from "@zeloscloud/app-extension-sdk/react";

function ExtensionPanel() {
  const bridge = useZelosBridge();
  const info = useExtensionInfo();
  const theme = useTheme();

  if (bridge.status === "error") {
    return <div>Bridge error: {bridge.error.message}</div>;
  }

  if (bridge.status === "loading") {
    return <div>Loading...</div>;
  }

  return (
    <div>
      <h1>{info.name}</h1>
      <p>Theme: {theme.preference}</p>
    </div>
  );
}

export function App() {
  return (
    <ZelosBridgeProvider>
      <ExtensionPanel />
    </ZelosBridgeProvider>
  );
}

Embedded app extensions boot from handshake-ack.snapshot. After the bridge is connected, the host pushes theme.changed and workspace.changed events whenever those values change. workspace can be null without putting the bridge into an error state.

Exports

  • @zeloscloud/app-extension-sdkconnectBridgeTransport(), MockBridge, and public bridge types/constants
  • @zeloscloud/app-extension-sdk/reactZelosBridgeProvider and hooks (useZelosBridge, useExtensionInfo, useTheme, useWorkspace)

Only the root entrypoint and ./react are supported public npm APIs. Low-level bridge internals are implementation details and are not part of the npm contract.