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

@zsign/embed

v0.1.0

Published

Embed a zSign signing session in an iframe with origin-guarded postMessage events.

Readme

@zsign/embed

Vanilla JS helper that mounts a zSign signing session in an iframe and listens for origin-guarded postMessage events from the signing page.

Requires Node 18+. Zero runtime dependencies.

For the React wrapper, see @zsign/react. The task-oriented walkthrough lives in the embed guide.

Install

npm install @zsign/embed

Allow the embedder origin first

Embedding is default-deny. A framed signing page refuses to render unless its parent origin is registered on the envelope owner's account:

curl -X PUT "$ZSIGN_BASE_URL/api/branding/embed-origins" \
  -H "Authorization: Bearer $ZSIGN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origins": ["https://app.yourcompany.com"]}'

ZSIGN_BASE_URL defaults to the public zSign API host.

Or Settings → Embedding in the dashboard. Exact match only, https required except http://localhost[:port], no paths or wildcards, max 10.

Usage

import { createSigningEmbed } from "@zsign/embed";

const handle = createSigningEmbed({
  signingUrl: "https://app.example.com/sign/<token>",
  container: document.getElementById("signing"),
  height: "auto",
  onReady: () => console.log("ready"),
  onSigned: ({ session_id }) => console.log("signed", session_id),
  onError: ({ message }) => console.error(message),
});

// Later:
handle.destroy();

signingUrl is a recipient signing link from POST /api/v1/documents/send (signing_urls) or the dashboard.

Events

The iframe posts { v: 1, type, payload } to the parent. The SDK only accepts messages whose event.origin matches the signing URL origin and whose event.source is the iframe window.

| type | callback | payload | Emitted by the live signing page when | | --- | --- | --- | --- | | zsign:ready | onReady | — | the session has loaded and framing is allowed | | zsign:signed | onSigned | { session_id? } | the signer completes the document | | zsign:error | onError | { message? } | completion fails | | zsign:resize | (iframe height) | { height } | the document body resizes (height: "auto" or omitted) | | zsign:declined | onDeclined | — | the iframe messenger type includes this event; listen for it |

Do not invent other event names. The protocol is v: 1 only.

Options

| Option | Type | Notes | | --- | --- | --- | | signingUrl | string | Required. Full signing-page URL. | | container | HTMLElement | Required. The iframe is appended here. | | height | number \| "auto" | Pixel height, or "auto" / omitted to follow zsign:resize. Default rendered height is 600px until a resize arrives. | | onReady | () => void | | | onSigned | (payload: { session_id?: string }) => void | | | onDeclined | () => void | | | onError | (payload: { message?: string }) => void | |

destroy() removes the iframe and the message listener.