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

@superwall/studio

v2.7.2

Published

The Superwall studio: paywall browsing, device preview, and editing surfaces. Shared between `superwall dev` (local studio) and the hosted dashboard.

Readme

Install

npm install @superwall/studio

You will not usually install this directly: the superwall framework depends on it and superwall dev serves it. It is a standalone vite + React + Tailwind app that is also a component library — one codebase, two hosts:

  • superwall dev serves the BUILT app (dist/, assets under /__studio/) plus the data endpoint and preview mounts — the local studio.
  • The hosted studio in the dashboard imports the component library (dist/lib/, the package's . export, plus the compiled @superwall/studio/studio.css) and renders SurfaceEditor over published snapshots and platform data. See Hosting.

Package layout

packages/studio/
├── index.html            the app shell (fonts, favicon)
├── vite.config.ts        vite + react + tailwind; /__studio/ base for builds
├── vite.lib.config.ts    the library build: dist/lib/index.js + studio.css
├── tsconfig.lib.json     declarations for the library build
├── src/
│   ├── main.tsx          entry: fetch /__studio/project.json → <StudioApp/>
│   ├── index.ts          the component-library barrel a hosted studio imports
│   ├── StudioApp.tsx     URL-driven router (list ⇄ editor)
│   ├── screens/          SurfaceList, SurfaceEditor
│   ├── components/       StudioShell, TopBar, Toolbar, DeviceFrame, VariablesPanel,
│   │                     ActionMenu, CompareMenu, SidePanel, controls, icons, …
│   ├── lib/              project.ts (wire-format parser, untrusted JSON,
│   │                     cast-free), preview.ts (preview URL builder),
│   │                     devices.ts (viewport + mock-device catalog),
│   │                     actions.ts (the dev server's shipping seam),
│   │                     promotion.ts (promote vs roll back), steps.ts,
│   │                     events.ts, time.ts, types.ts
│   └── styles.css        tailwind @theme tokens + stateful primitives
└── dist/                 built by the workspace postinstall: the app, and
                          the library under dist/lib/

Data seam

Everything renders from a StudioSource — { title, surfaces, diagnostics?, samples?, previewUrl, actions? }. Locally that's /__studio/project.json (the dev server evaluates configs server-side and ships sample device/user/params/product data alongside) plus devServerActions, the /__studio/action, /__studio/status and /__studio/samples/<project>/<kind>/<id>?platform= implementation of the shipping seam. SurfaceEditor asks actions.samples(surface, platform) for the open surface and the selected device's platform (ios, android, none for Responsive and Desktop) and asks again when the device changes, so the catalogue comes from the app that surface ships to on that platform. Until the answer arrives the samples stay empty and pending, never another app's. A host without samples passes them in StudioSource.samples instead. A hosted studio swaps the fetch and the seam, nothing else. previewUrl(surface) decides what the preview iframes load: /preview/<kind>/<id> mounts locally, published snapshot URLs in the dashboard. Both carry ?transport=editor, which makes the paywall talk to its parent window, and the studio is that parent.

The studio is a paywall host in the SDK's sense, through @superwall/host. Each DeviceFrame answers its paywall's ping with the same burst the web host sends (template_variables, experiment, products, template_substitutions_prefix, paywall_open), built from the host state SurfaceEditor assembles: the API's device and user samples (or the host package's defaults), the selected device frame's platform/deviceModel/ osVersion, the theme as interfaceStyle, the chosen locale as deviceLocale, one product per slot with the catalogue's variables (or the visual editor's example prices for a slot the catalogue cannot price), and whatever the Variables panel edits on top. Every edit re-sends only what changed; nothing reloads. Purchases, restores, permissions and callbacks come back as prompts in the toasts and are answered with the messages the iOS SDK sends. Nothing about this is specific to the studio: the paywall cannot tell it from a device.

Hosting

The dashboard opens a code-first paywall in this studio instead of the visual editor. What the library gives a host:

  • snapshotPreviewUrl(urlOf) — a previewUrl that resolves each surface to its published snapshot URL and adds transport=editor. Set paywallId, paywallIdentifier, products and locales on each StudioSurface from the paywall and version records; the studio hosts the snapshot from them. hostStateFor and hostPatch are exported for a host that wants to drive a DeviceFrame itself.
  • One StudioSurface per version, told apart by label ("v12 · Live") and carrying its version; StudioSource.compareHint names what the compare menu offers, and SurfaceEditor's actions slot takes the host's own controls (a version switcher, say).
  • StudioSource.actions is the shipping seam: offered names the actions the host can run (push, promote, publish), run(surface, { action, version? }, onStep) performs one and streams its steps, status(surface) lists the pushed versions with the live one marked. With none, there is no push/promote UI. The pushed versions sit in a picker at the start of the action button group, and the studio labels the button Promote or Roll back by where the picked version sits against the live one (promotionDirection). A host that can only promote (the dashboard, which has no project on disk) offers ["promote"] and a pick that switches the surface, so the menu collapses to the picker and one button; the local studio keeps its own pick and sends a version only when one was chosen.
  • Canvas is the zoomable stage the studio previews on, with useCanvasScale for what it draws and a CanvasHandle ref (fit, actualSize, zoomStep, zoomTo, zoom(), pan, hold). inset sets the fit margin (48px by default). contained is for a stage inside a page that scrolls, such as a chat: a plain wheel scrolls the page, a pinch or ctrl-wheel zooms, a finger scrolls the page until the stage is zoomed in, and the zoom keys and Space reach it only while it is hovered or focused. Resizing the stage refits it, or re-centres it at the zoom it was left at. percent formats a scale for a zoom readout.
  • chromeFor, deviceVariablesFor, isWebOnly and webViewportFor are the device rules the studio draws with: the frame chrome for a device (none on web), the device variables a paywall reads, whether a paywall targets only web, and the viewport a browser leaves on a device.
  • StudioShell (position="absolute" when the host owns the viewport) is the ink stage every screen expects, and it carries the sw-studio class the stylesheet scopes its base rules to.
  • @superwall/studio/studio.css is compiled Tailwind v4 output including a preflight. Mount it in a shadow root (or an iframe) rather than beside another design system — the dashboard does exactly that, and re-registers the sheet's @property rules at document level, where browsers expect them.
  • @superwall/studio/products is the pure mapping from a dashboard product (the v2 API shape) to the variables a paywall reads (price, periodly, trialPeriodDays, trialPeriodPrice, …), with amounts in the currency's own minor units. superwall dev uses it; the dashboard builds its samples with its own pricing engine, so the two must be kept in step by hand.
  • @superwall/studio/contract is a types-only entry: the action, status, per-surface samples and app-scheme shapes the CLI implements for the framework's preview server, importable from node without DOM types. @superwall/studio/styles.css is the Tailwind source for hosts that run their own v4 pipeline.

Screens

  • SurfaceList — every paywall and funnel as a card with a live, non-interactive miniature (a real preview at 393×852, scaled).
  • SurfaceEditor — the paywall alone on an ink stage in one plain device frame, with a single bottom toolbar: device switching (STUDIO_DEVICES: nine devices, iPhone SE to iPad Pro to Pixel to Desktop — each switch also flips the mock SDK's platform/model/OS), light/dark simulation, locale switching, and a Variables button that slides in a right-hand panel of controls for the User, Device, Params and Products groups the SDK reports. Override changes hot-swap: the next frame loads hidden and crossfades, so nothing ever flashes white. Shipping happens here too: an action menu runs Push, Publish and Promote beside a picker of the pushed versions, reading Roll back when the picked one is older than what is live, and a Compare menu splits the stage against any pushed version of the paywall (the live one marked) or another local one.

Design

The Application register of the Superwall design system (superwall.com/design.md): ink-dark chrome always (the preview carries light/dark, not the studio), hairline seams, mono chips, Manrope 500/400/600 with Roboto Mono micro-labels, teal accent, and paper-flat square geometry — switches are the only carved-out rounded shape, device frames are plain rectangles.

Tailwind v4 (src/styles.css): design tokens as @theme variables (so bg-ink, text-cream/55, border-cream/10 are utilities), layout inline in components, and only stateful primitives (.sw-btn, .sw-chip, .sw-select, .sw-segmented, .sw-switch, .sw-input) as component classes. Runtime dependencies are React (a peer) and sonner for toasts — icons are inlined Lucide-geometry SVGs.

Develop

This package lives in the superwall/superwall monorepo. Read AGENTS.md first - the conventions in it are decided, not suggested.

bun install
bun dev               # the studio alone on port 6200, proxied to a running
                      # `superwall dev` (port 6100) in any project — HMR against
                      # real paywalls
bun run build         # dist/ (what `superwall dev` serves) and dist/lib/ (the library)
bun run test
bun run typecheck

The workspace postinstall builds dist/, so a fresh clone of the monorepo has a studio to serve from the first superwall dev.

License

Functional Source License (FSL-1.1-ALv2): use it, modify it, embed it, ship it — anything except building a competing product with it — and every release becomes Apache 2.0 two years after publication.