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

@tryghost/portal

v2.71.32

Published

Drop-in membership interface for Ghost sites

Readme

Portal

npm version

Drop-in script to make the bulk of Ghost membership features work on any theme.

Usage

Ghost automatically injects the Portal script on all sites running Ghost 4 or higher.

Alternatively, Portal can be enabled on pages outside Ghost by adding this script:

<script defer src="https://unpkg.com/@tryghost/portal@latest/umd/portal.min.js" data-ghost="https://mymemberssite.com"></script>

The data-ghost attribute expects the URL for your Ghost site, which is the only input Portal needs to work with your site's membership data via Ghost APIs.

Custom trigger button

By default, the script adds a default floating trigger button on the bottom right of your page which is used to trigger the popup on screen.

You can add a custom trigger by adding the data-portal attribute to any HTML element. Set its value to choose a specific Portal page, for example data-portal="signup".

Share modal can be opened with data-portal="share" (or #/share).

Default (zero-config) usage:

<button type="button" data-portal="share">Share</button>

On pages where {{ghost_head}} is rendered, Portal will auto-resolve metadata from DOM tags:

  • URL: canonical URL (or current URL fallback)
  • Title: Open Graph title (or document title fallback)
  • Image: Open Graph image (or Twitter image fallback)

Troubleshooting missing preview metadata:

  1. Verify the template includes {{ghost_head}}.
  2. Verify rendered HTML contains canonical + OG/Twitter tags.

The script adds gh-portal-open and gh-portal-close classes to custom triggers to reflect the popup state.

See the Portal settings documentation for ways to customize Portal for your site.

Develop

Portal runs automatically with Ghost's standard development command from the monorepo root:

pnpm dev

This starts Ghost, Admin, and Portal. Portal is served through the development gateway at http://localhost:2368/ghost/assets/portal/portal.min.js and loaded into theme pages on the development site. Use pnpm dev:public when changing Portal alongside the other public apps.

Build

From this directory, create a production minified bundle in umd/portal.min.js with:

pnpm build

Test

From this directory, run unit tests once or in watch mode with:

pnpm test
pnpm test:watch

Ghost e2e tests

Portal is primarily tested through Ghost's Playwright tests in the e2e/ directory. Run them from the monorepo root:

pnpm test:e2e

Release

Patch releases are automatic. When Portal changes on main, CI publishes the next patch version to npm and clears the jsDelivr cache. Sites using that major/minor line receive the patch without a Ghost release.

If you're releasing new code that should not immediately go live always use a minor or major version when publishing.

For an intentional minor or major release:

  1. From a clean branch, run pnpm ship and select a minor or major version
  2. Merge the release commit to main
  3. Wait for a public Ghost release to ship the new default version line

pnpm ship updates both the package version and Ghost's default Portal version.

Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.