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

@getoverflow/payment-elements

v0.0.0-bootstrap.0

Published

Thin async loader for the Overflow Payment Elements SDK.

Readme

@getoverflow/payment-elements

Thin async loader for the Overflow Payment Elements SDK. It injects the Overflow.js bundle from Overflow's CDN and gives you a typed, promise-based handle to the SDK -- the same idea as @stripe/stripe-js.

  • Tiny, dependency-free loader (the SDK itself is served from the CDN)
  • First-class TypeScript types, generated from the SDK's source of truth
  • SSR-safe: loadOverflow(...) resolves null in non-browser environments
  • Loads the latest, always-patched build by policy (see Latest-only)

Full docs: https://docs.overflow.co · npm: https://www.npmjs.com/package/@getoverflow/payment-elements

Install

npm install @getoverflow/payment-elements

Quickstart (npm / bundler)

import { loadOverflow } from '@getoverflow/payment-elements';

const overflow = await loadOverflow('pk_live_...');

// `overflow` is null in SSR / non-browser contexts -- guard before use.
overflow?.card().mount('#card');

Importing the package eagerly starts downloading the CDN bundle (a side effect, mirroring @stripe/stripe-js), so the SDK is in flight before your app mounts.

Defer the fetch with /pure

If you want to control exactly when the CDN request happens (for example, defer it until the checkout screen mounts), import from the /pure subpath. It has the same API with no import side effect -- nothing loads until you call loadOverflow().

import { loadOverflow } from '@getoverflow/payment-elements/pure';

async function mountCheckout() {
  const overflow = await loadOverflow('pk_live_...');
  overflow?.card().mount('#card');
}

This works the same way in React, Vue, Next.js, and other frameworks. In SSR frameworks, remember that loadOverflow(...) resolves null on the server, so call it from client-side code (an effect / event handler) and guard the result.

Script tag (no install)

You can also drop the SDK in directly with a script tag, then use the global Overflow constructor:

<script src="https://cdn.overflow.co/sdk/v1/payment-elements.js"></script>
<script>
  const overflow = new Overflow('pk_live_...');
  overflow.card().mount('#card');
</script>

Types for script-tag / CMS authors

A bare script tag gives you zero editor types. If you author in a CMS (WordPress, Drupal) or a plain HTML project and want window.Overflow typed, opt into the ambient declarations without bundling anything:

  • Add @getoverflow/payment-elements as a dev-only dependency and reference the ambient types from a *.d.ts (or the top of a TS file):

    /// <reference types="@getoverflow/payment-elements/types" />
  • Or download global.d.ts and reference it from a local *.d.ts file in your project.

The ambient ./types entry is the opt-in that makes window.Overflow typed; it ships no JavaScript.

Latest-only policy

The loader and the documented script URL always point at the floating latest v1 build (https://cdn.overflow.co/sdk/v1/payment-elements.js). Pinning to a specific immutable version URL is deliberately not supported: serving only the latest build is a compliance and security requirement, so that no integrator can pin themselves onto a stale bundle that misses a security fix. There is no SRI / pinned-URL / setLoadParameters API.

If you have a hard requirement to self-host or pin a specific build, you do so on your own, outside this loader.

TypeScript

Types ship with the package. The SDK types (PublicKey, OverflowOptions, OverflowInstance, etc.) are generated from the SDK's single source of truth and kept in lockstep with each release, so the loader argument and return types always match the runtime constructor.

Versioning

The npm version mirrors the Overflow Payment Elements SDK version 1:1. Every published SDK release becomes a matching npm version and GitHub Release. Prereleases publish under the next dist-tag, so a bare npm install @getoverflow/payment-elements never resolves to a prerelease.

Contributing

The loader in this repo is open source (MIT). The core SDK served from the CDN is closed-source. Loader bug fixes, docs, and tests are welcome -- see CONTRIBUTING.md. Files under types/ are generated and should not be hand-edited.

License

MIT