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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tlord101/permit2-widget

v0.1.0

Published

Lightweight widget SDK to open a Permit2 signing popup and return saved permit signatures.

Readme

@tlord101/permit2-widget

Lightweight client SDK to open a Permit2 signing popup and return the saved permit signature. Designed to let other sites integrate your hosted signing flow with a single script or npm install.

Features

  • Popup-based signing flow that opens your hosted app and returns a { type: 'permit2_result', ... } object.
  • open() to programmatically open the popup and await the result.
  • attach() to bind the flow to DOM buttons or selectors.
  • Auto-attach: elements with data-permit2-app will be wired automatically.

Install

From npm (when published):

npm install @tlord101/permit2-widget

CDN / UMD

After publishing, a UMD build will be available via jsDelivr or unpkg. Example:

<script src="https://cdn.jsdelivr.net/npm/@tlord101/permit2-widget/dist/index.umd.js"></script>
<script>
  // global: Permit2Widget
</script>

Quick usage

Programmatic:

import Permit2Widget from '@tlord101/permit2-widget';

const result = await Permit2Widget.open('https://your-app.example.com', { timeout: 300000 });
console.log(result);

Attach to buttons:

<button id="signBtn">Sign Permit</button>
<script>
  import Permit2Widget from '@tlord101/permit2-widget';
  Permit2Widget.attach('#signBtn', 'https://your-app.example.com', {
    onResult(result) { console.log('signed', result); },
    onError(err) { console.error(err); }
  });
</script>

Auto-attach via data-attribute:

<button data-permit2-app="https://your-app.example.com">Sign Permit</button>
<script src="https://your-app.example.com/dist/your-widget-umd.js"></script>

Security notes

  • Consumers should validate event.origin when listening for postMessage on the page.
  • Popup-based flows are recommended: many wallets block or limit embedded iframes.

Publishing & CI

  • This package includes an esbuild-based build script (scripts/build.js).
  • A recommended GitHub Actions workflow (added in the repo root) will publish the package to npm when a git tag is pushed and NPM_TOKEN secret is configured.

License: MIT