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

@peakgateway/web-sdk

v0.4.12

Published

Peak Gateway Web SDK - Apple Pay & Google Pay integration for browsers

Readme

@peakgateway/web-sdk

Browser SDK for Peak Gateway checkout sessions, Apple Pay, Google Pay, and gift cards.

This package intentionally does not expose payment tokens to browser callers. Use mountSecureCardFields for compact, Gateway-hosted secure card entry. Direct CDE integrations can still submit through an existing session with payWithCard.

Install

npm install @peakgateway/web-sdk

Secure card fields

import { mountSecureCardFields } from '@peakgateway/web-sdk'
import type { SecureCardEvent } from '@peakgateway/web-sdk'

const fields = mountSecureCardFields({
  container: document.getElementById('card-fields')!,
  url: checkoutOrSetupIntentUrl,
  onEvent(event: SecureCardEvent) {
    if (event.type === 'change') submitButton.disabled = !event.complete
  },
})
// Wait for ready before confirming with the authoritative checkout amount.
const result = await fields.confirm({
  amount,
  currency,
  context: { cardHolderName, billingStreet, billingCity, billingState, billingCountry, billingZip },
})
// Setup intents use { context } without checkout amount/currency.
// Dispose when removing the fields from the page.
fields.destroy()

Use the Gateway HTTPS checkout or setup-intent URL. The controller mounts a cross-origin Gateway iframe; PAN, expiry, and CVC remain inside that iframe and never appear in merchant inputs or SDK event payloads. The browser package exports the controller, options, style, event, result, brand, and error types from its root.

Card payment

import { PeakGateway } from '@peakgateway/web-sdk'

const peak = new PeakGateway({ sessionId, sessionToken })
const result = await peak.payWithCard({
  cardNumber,
  expirationDate,
  cvv,
  cardHolderName,
  billingStreet,
  billingZip,
})

The SDK returns the payment result, never a reusable processor or canonical token.

Apple Pay / Google Pay

See peak.applePay and peak.googlePay.

Gift cards

Use peak.giftCard.balanceCheck() to display the available balance before payment.

Authentication and routing

The browser SDK uses the generated public checkout models from @peakgateway/sdk. Initialize it with a checkout session and its scoped session token. Never embed an API key or OAuth client secret in browser code; create sessions on your server with @peakgateway/sdk instead.

License

MIT: see LICENSE.