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

webhanger-front

v1.0.12

Published

WebHanger browser SDK — load encrypted UI components from CDN

Readme

webhanger-front

Browser SDK for WebHanger. Loads encrypted UI components from CDN and injects them into the DOM. No eval, no readable source — decrypted in memory and applied directly.

Note: This package uses fetch to load components from your CDN. This is expected behavior and is flagged as an informational notice by npm's security scanner — not a vulnerability.


Install

npm install webhanger-front

Or via script tag:

<script src="https://unpkg.com/webhanger-front/browser.js"></script>

Usage

Script tag (plain HTML)

<div data-wh></div>

<script src="https://unpkg.com/webhanger-front/browser.js"></script>
<script>
  WebHangerFront.load(
    "https://xxx.cloudfront.net/components/[email protected]",
    "wh_1234567890",   // projectId from webhanger.config.json
    "your-token",
    0                  // expires: 0 = never, or unix timestamp
  );
</script>

ESM (Vite, Webpack, Rollup)

import { load } from "webhanger-front";

await load(
  "https://xxx.cloudfront.net/components/[email protected]",
  "wh_1234567890",
  "your-token",
  0
);

React

import { useEffect } from "react";
import { load } from "webhanger-front";

export default function Navbar() {
  useEffect(() => {
    load(
      "https://xxx.cloudfront.net/components/[email protected]",
      "wh_1234567890",
      "your-token",
      0,
      "#navbar-mount"
    );
  }, []);

  return <div id="navbar-mount" />;
}

Vue

<template>
  <div ref="mount" />
</template>

<script setup>
import { onMounted, ref } from "vue";
import { load } from "webhanger-front";

const mount = ref(null);

onMounted(() => {
  load(
    "https://xxx.cloudfront.net/components/[email protected]",
    "wh_1234567890",
    "your-token",
    0,
    "#navbar-mount"
  );
});
</script>

API

load(cdnUrl, projectId, token, expires, selector?)

| Param | Type | Description | |---|---|---| | cdnUrl | string | Full CDN URL of the component | | projectId | string | Your WebHanger project ID — used as decrypt key | | token | string | HMAC signed token from wh deploy | | expires | number | Unix timestamp expiry. 0 = never expires | | selector | string | CSS selector for mount target. Default: [data-wh] |

await load(cdnUrl, projectId, token, expires, "[data-wh]");

clearCache()

Clears all cached components from localStorage and IndexedDB.

import { clearCache } from "webhanger-front";
await clearCache();

version

import { version } from "webhanger-front";
console.log(version); // "1.0.0"

Caching

Components are automatically cached after first load:

| Size | Storage | |---|---| | < 50KB | localStorage | | >= 50KB | IndexedDB |

Cache key is cdnUrl@expires — changing the version or expiry busts the cache automatically.


Offline support

Register the service worker from the webhanger package for offline component delivery:

navigator.serviceWorker.register("/webhanger.sw.js");

How it works

  1. Fetches encrypted JSON payload from CDN
  2. Decrypts each chunk in memory using projectId as cipher key
  3. Injects CSS into <head>, HTML into mount target, JS via <script>
  4. No eval — browser parses JS natively
  5. Payload on CDN is unreadable without the projectId