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/server-js

v0.0.5

Published

Server-side JavaScript SDK for Proxy merchant API calls.

Readme

@proxy-checkout/server-js

Server-side JavaScript SDK for merchant backends calling Proxy merchant APIs.

Exposed API Endpoints

This package should expose the merchant-authenticated backend routes that exist today:

| SDK method | HTTP endpoint | Purpose | | --- | --- | --- | | proxy.sessions.create | POST /proxy_sessions | Create a Proxy Elements session. | | proxy.sessions.createHandoff | POST /proxy_sessions/handoff | Create a Proxy session and atomically mark it ready for hosted payer handoff. | | proxy.sessions.retrieve | GET /proxy_sessions/:id/merchant | Retrieve current merchant-owned session state after a webhook or before creating PSP objects. | | proxy.sessions.cart.set | PUT /proxy_sessions/:id/cart | Replace the current cart snapshot before payment orchestration. | | proxy.sessions.payerHandoff | POST /proxy_sessions/:id/payer_handoff | Record merchant handoff issuance before the payer loads checkout. | | proxy.sessions.payerOpened | POST /proxy_sessions/:id/payer_opened | Record checkout open and read the current merchant session/cart state. | | proxy.subscriptions.retrieve | GET /subscriptions/:id | Retrieve current Proxy-linked subscription lifecycle state. | | proxy.webhookEndpoints.list | GET /webhook_endpoints | List outbound merchant webhook endpoints. | | proxy.webhookEndpoints.create | POST /webhook_endpoints | Create an outbound endpoint and receive its one-time signing secret. | | proxy.webhookEndpoints.get | GET /webhook_endpoints/:id | Read one outbound endpoint. | | proxy.webhookEndpoints.update | PATCH /webhook_endpoints/:id | Update URL, event types, or active/inactive status. | | proxy.webhookEndpoints.archive | POST /webhook_endpoints/:id/archive | Archive an outbound endpoint. | | proxy.webhookEndpoints.rotateSecret | POST /webhook_endpoints/:id/rotate_secret | Rotate an outbound endpoint signing secret. |

Usage

import { createProxyCheckoutServerClient } from "@proxy-checkout/server-js";

const proxy = createProxyCheckoutServerClient({
  apiKey: process.env.PROXY_SECRET_KEY!,
  publishableKey: process.env.PROXY_PUBLISHABLE_KEY!,
  payHost: process.env.PROXY_PAY_HOST,
});

const handoff = await proxy.sessions.createHandoff({
  amountMinor: 5000,
  buyerReference: "buyer_123",
  currency: "usd",
  cartSnapshot: {
    items: [{ product_id: "prod_123", quantity: 1 }],
  },
  idempotencyKey: "order_123",
  // Optional: omit in normal production flows to use the dashboard default.
  // Preview/staging/multi-origin environments may override the merchant payer page.
  payerDestinationUrl: "https://preview.example.com/checkout",
});

console.log(handoff.handoffUrl);

const currentSession = await proxy.sessions.retrieve(handoff.id);
console.log(currentSession.buyerReference);

const opened = await proxy.sessions.payerOpened(handoff.id);
console.log(opened.buyerReference, opened.cartSnapshot);

const endpoint = await proxy.webhookEndpoints.create({
  url: "https://example.com/proxy-webhooks",
  eventTypes: ["proxy_session.paid", "proxy_session.expired"],
});

console.log(endpoint.signingSecret);

Verify and parse outbound webhooks with the exact raw request body:

import { constructProxyWebhookEvent } from "@proxy-checkout/server-js";

const event = constructProxyWebhookEvent({
  body: rawBodyBuffer,
  header: request.headers["proxy-signature"],
  secret: process.env.PROXY_WEBHOOK_SIGNING_SECRET!,
});

if (event.type === "subscription.renewed") {
  const subscription = await proxy.subscriptions.retrieve(event.data.subscription_id);
  console.log(subscription.currentPeriodEnd);
}

Production calls default to https://api.proxycheckout.com. Tests, local development, and previews can pass apiHost.

Configure a production/default payer destination and allowed hosts in the Proxy dashboard. payerDestinationUrl is optional. Most production integrations can omit it and use the dashboard default. Preview, staging, or multi-origin environments may pass payerDestinationUrl to sessions.createHandoff(...); Proxy validates the host against the configured allowed hosts, stores the destination on the handoff session, and forwards the payer there when the hosted handoff opens.

First Publish Decisions

The first public package versions are intentionally 0.0.x because the SDK API is early and expected to change. The npm package is MIT-licensed under the package-scoped LICENSE file.

The package metadata is intentionally shaped for a public npm package, but the first publish still needs explicit owner approval for:

  • release automation, provenance, dist tags, and rollback ownership.