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

@proxy-checkout/stripe-server-js

v0.0.1

Published

Server-side Stripe adapter for Proxy Checkout: required metadata, provider binding, openCheckout, and cart sync.

Downloads

2,465

Readme

@proxy-checkout/stripe-server-js

Server-side Stripe adapter for Proxy Checkout. It owns the Stripe-specific integration protocol so merchant backends never hand-roll it:

  • requiredMetadata(proxySession) — the proxy_session_id metadata Proxy needs on the Checkout Session, Subscription, and PaymentIntent.
  • assertCheckoutSessionBelongsToProxy / assertSubscriptionBelongsToProxy / assertPaymentIntentBelongsToProxy — provider-object ownership checks.
  • openCheckout(...) — records payer-opened, validates/reconciles the typed cart with rollback, injects required metadata, creates the Stripe Checkout Session with deterministic idempotency, records the Proxy provider binding, and returns the client secret. The merchant only supplies app-specific Stripe params.
  • syncCheckoutCart(...) — validates the stored Proxy provider binding, then updates the Proxy cart and the Stripe Checkout line_items in the safest order with deterministic rollback/reconciliation (ProxyStripeCartSyncError).

PSP-agnostic primitives (sessions, subscriptions, webhooks, lifecycle) live in @proxy-checkout/server-js. This package is an additive adapter on top and is dependency-free: you inject your own Stripe instance and your @proxy-checkout/server-js client.

Install

npm install --save-exact @proxy-checkout/stripe-server-js @proxy-checkout/server-js stripe

Usage

import Stripe from "stripe";
import { createProxyCheckoutServerClient } from "@proxy-checkout/server-js";
import { openCheckout, syncCheckoutCart } from "@proxy-checkout/stripe-server-js";

const proxy = createProxyCheckoutServerClient({ apiKey: process.env.PROXY_SECRET_KEY! });
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2025-12-15.clover" });

// Create the merchant-owned Stripe checkout, correctly linked to the Proxy session.
const checkout = await openCheckout({
  proxy,
  stripe,
  proxySessionId,
  cartSchema, // a zod-style schema, or any (value) => Cart validator
  validateCart: ({ cart }) => buildMerchantOffer(cart),
  buildCheckoutSessionParams: ({ cart, offer }) => ({
    ...buildMerchantStripeParams(cart, offer),
    mode: "subscription",
    ui_mode: "custom",
  }),
});
// checkout.clientSecret -> render Stripe Elements

// Cart edits go through the binding-validated sync helper.
await syncCheckoutCart({
  proxy,
  stripe,
  proxySessionId,
  checkoutSessionId: checkout.checkoutSession.id,
  cartSchema,
  input: { interval: "year" },
  buildNextCart: ({ currentCart, input }) => buildMerchantCart(currentCart, input),
  buildStripeLineItems: (cart) => cart.lineItems,
});

Use the delegated-checkout guide from your Proxy onboarding materials for the full four-route integration recipe.