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

@solvapay/server

v1.2.1

Published

[![npm version](https://img.shields.io/npm/v/@solvapay/server.svg)](https://www.npmjs.com/package/@solvapay/server) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Readme

@solvapay/server

npm version License: MIT

Universal server SDK for Node.js and edge runtimes — API client, paywall protection, and webhook verification.

When to use this package: protect HTTP routes, Next.js handlers, background jobs, or low-level MCP tool handlers. For a full MCP server with transport tools and widget UI, prefer npm create solvapay@latest <name> -- --type mcp or @solvapay/mcp.

Works in: Node.js, Vercel Edge, Cloudflare Workers, Deno, Supabase Edge Functions, and more.

Install

pnpm add @solvapay/server

Quickstart

import { createSolvaPay } from '@solvapay/server'

const solvaPay = createSolvaPay({ apiKey: process.env.SOLVAPAY_SECRET_KEY })
const payable = solvaPay.payable({ product: 'prd_YOUR_PRODUCT' })

app.post(
  '/tasks',
  payable.http(async args => ({ id: 'task_1', ...args })),
)

Guide: Express integration

Basic client

The same imports work in Node and edge runtimes — the correct crypto implementation is selected automatically:

import { createSolvaPayClient, verifyWebhook } from '@solvapay/server'

const apiClient = createSolvaPayClient({
  apiKey: process.env.SOLVAPAY_SECRET_KEY!,
})

const event = await verifyWebhook({ body, signature, secret: process.env.SOLVAPAY_WEBHOOK_SECRET! })

Web-standards runtimes — @solvapay/server/fetch subpath

For Deno / Supabase Edge / Cloudflare Workers / Bun, use ready-made (req: Request) => Promise<Response> handlers:

// supabase/functions/check-purchase/index.ts
import { checkPurchase } from '@solvapay/server/fetch'

Deno.serve(checkPurchase)

Available handlers include checkPurchase, createPaymentIntent, processPayment, listPlans, syncCustomer, createCheckoutSession, createCustomerSession, solvapayWebhook, and more.

Guide: Supabase Edge · Example: examples/supabase-edge

Paywall adapters

const payable = solvaPay.payable({ product: 'my-product' })

app.post('/tasks', payable.http(handler))           // Express / Fastify
export const POST = payable.next(handler)           // Next.js App Router
server.setRequestHandler(..., payable.mcp(handler)) // MCP (low-level)
const fn = await payable.function(handler)          // Direct / jobs / tests

| Adapter | Use when | | -------------------- | ---------------------------------- | | payable.http() | Express, Fastify, traditional HTTP | | payable.next() | Next.js App Router | | payable.mcp() | MCP tool handlers (low-level) | | payable.function() | Tests, cron, non-HTTP contexts |

Authentication

Integrate @solvapay/auth via getCustomerRef. Fail closed on missing auth — do not fall back to shared identities like anonymous:

import { SupabaseAuthAdapter } from '@solvapay/auth/supabase'

const auth = new SupabaseAuthAdapter({ jwtSecret: process.env.SUPABASE_JWT_SECRET! })

export const POST = payable.next(handler, {
  getCustomerRef: async req => {
    const userId = await auth.getUserIdFromRequest(req)
    if (!userId) throw new Error('Unauthorized')
    return userId
  },
})

MCP servers

@solvapay/server is framework-free. For batteries-included MCP:

Guide: MCP

API client methods

createSolvaPayClient implements:

  • checkLimits(params) — usage limits; auto-enrolls on first call for free default plans
  • trackUsage(params) — metered billing; returns the recorded usage reference and any credit debit result
  • trackUsageBulk({ events }) — record several metered usage events in one request
  • assignCredits(params) — grant credits to a customer balance with optional idempotency
  • createCustomer(params) / getCustomer(params) — customer lifecycle

Full reference: Server SDK docs

Contributing

Type generation and integration-test details live in contributor docs — not duplicated here:

See also

Support