BlogWork With Me →
Open Source · MIT Licensed

Stop juggling payment APIs.
Use one.

PayKit gives you a single, type-safe API for accepting payments across Stripe, Razorpay, PayPal, and more. Write your integration once — swap providers without changing a line of code.

252 tests passingTypeScript-firstMIT Licensed
stripe-checkout.ts
import { PayKit } from '@squaredr/paykit'; import { StripeAdapter } from '@squaredr/paykit-stripe'; const paykit = new PayKit({ adapter: new StripeAdapter({ secretKey: '...' }) }); const charge = await paykit.charges.create({ amount: 5000, currency: 'usd', });
Live Demo

Try it live

Real Stripe & Razorpay test payments. Pick a provider manually or let PaymentRouter choose based on currency.

PayKit Pro LicenseLifetime access to all premium adapters
1 × PayKit Pro License$49.00
Subtotal$49.00
Total$49.00 USD
Demo mode — no real charges
Loading checkout…
How It Works

One API. Any provider.

PayKit sits between your app and payment providers. The adapter pattern lets you swap providers by changing a single line.

{ }
Your AppExpress / Next.js
PK
PayKit Core@squaredr/paykit
ST
Stripe Adapter@squaredr/paykit/stripe
API
Stripe APIapi.stripe.com
// Only this line changes:
import { StripeAdapter } from '@squaredr/paykit/stripe';
Before & After

Kill the spaghetti code

Replace provider-specific branches with a single, clean interface.

Without PayKit // Without PayKit — provider-specific spaghetti import Stripe from 'stripe'; import Razorpay from 'razorpay'; const stripe = new Stripe(process.env.STRIPE_KEY!); const razorpay = new Razorpay({ key_id: process.env.RZP_KEY!, key_secret: process.env.RZP_SECRET!, }); async function charge(provider: string, amount: number) { if (provider === 'stripe') { const intent = await stripe.paymentIntents.create({ amount, currency: 'usd', payment_method_types: ['card'], }); return { id: intent.id, clientSecret: intent.client_secret, status: intent.status, }; } else if (provider === 'razorpay') { const order = await razorpay.orders.create({ amount: amount * 100, currency: 'INR', receipt: `receipt_${Date.now()}`, }); return { id: order.id, clientSecret: order.id, status: order.status, }; } // ... more providers, more branches }
With PayKit // With PayKit — one API, any provider import { PayKit } from '@squaredr/paykit'; import { StripeAdapter } from '@squaredr/paykit/stripe'; const paykit = new PayKit({ adapter: new StripeAdapter({ secretKey: process.env.STRIPE_KEY!, }), }); const charge = await paykit.charges.create({ amount: 5000, currency: 'usd', metadata: { orderId: 'order_123' }, }); // Switch to Razorpay? Just swap the adapter. // Zero changes to your business logic.
0

lines of boilerplate eliminated

Features

Everything you need to accept payments

PayKit handles the complexity so you can focus on building your product.

Unified API

One interface for every payment provider. Write integration code once, swap providers without touching business logic.

Type-Safe

Full TypeScript support with generics for provider-specific types. Catch errors at compile time, not in production.

Framework-Agnostic

Works with Next.js, Express, Fastify, Hono, vanilla Node.js, Deno, and Bun. No framework lock-in.

Provider Routing

Route payments by currency, region, or custom rules. Send INR to Razorpay, USD to Stripe — automatically.

Webhook Normalization

Unified webhook events across providers. One handler for payment.succeeded regardless of the source.

Lightweight

Separate server and client entry points. Only bundle what you use — adapters, frontend SDKs, and React components.

Provider Support

Adapters for every provider you need

Stripe, Razorpay, and PayPal adapters are free forever. Additional providers are available as paid adapter bundles.

Free & Open Source
Stripe
CardsWallets3D SecureWebhooks
Razorpay
CardsUPINetbankingWebhooks
PayPal
PayPal BalanceCardsPay LaterWebhooks
Paid Adapter Bundles
Square
CardsApple PayGoogle Pay
Adyen
CardsiDEALSEPA
Cashfree
CardsUPINetbanking
PhonePe
UPICardsWallets
Mollie
CardsiDEALBancontact
Coming Soon
Flutterwave
CardsMobile MoneyBank Transfer
MercadoPago
CardsPixBoleto
Why PayKit

The middle ground between DIY and vendor lock-in

You shouldn't have to choose between writing everything from scratch or paying per-transaction fees to an orchestration platform.

DIY Integration

Build it yourself

  • Separate SDK per provider
  • Custom type definitions
  • Manual webhook parsing
  • Provider-specific error handling
  • Rewrite when switching providers
PayKit

One SDK, every provider

  • Single API across all providers
  • Full TypeScript coverage built-in
  • Unified webhook events
  • Consistent error types
  • Swap adapters, keep your code
Orchestration Platforms

Hosted services

  • Vendor lock-in to their API
  • Per-transaction fees on top of gateway fees
  • Data routes through third-party servers
  • Limited customization
  • Compliance overhead for PCI/SOC2
Try It

See the code in action

Explore the backend, frontend, and webhook integration patterns.

import { PayKit } from '@squaredr/paykit';
import { StripeAdapter } from '@squaredr/paykit/stripe';

const paykit = new PayKit({
  adapter: new StripeAdapter({
    secretKey: process.env.STRIPE_SECRET_KEY!,
  }),
});

// Create a payment session
const charge = await paykit.charges.create({
  amount: 2999,
  currency: 'usd',
  metadata: { orderId: 'order_456' },
});

console.log(charge.id);           // "ch_..."
console.log(charge.clientSecret); // Send to frontend
Pricing

Free core. Pay only for extra providers.

Stripe, Razorpay, and PayPal are free forever. Need more providers? Grab a bundle — one-time purchase, no subscriptions.

Open Source
$0
forever
Stripe adapter
Razorpay adapter
PayPal adapter
React components & hooks
Webhook verification
Multi-provider routing
Get Started
Best ValueAll Access
$149
one-time
Everything in Free
PhonePe, Cashfree, Paytm, CCAvenue
Square, Adyen, Mollie
MercadoPago, Flutterwave
All future adapters included
Lifetime updates
21+ providers — every adapter, forever
Individual
$19
per adapter
Pick any single paid adapter
Lifetime updates for that adapter
Or save with bundles:
India Pack — 4 adapters for $49
Global Pack — 5 adapters for $79
No subscriptions — pay once, use forever

All adapters ship in @squaredr/paykit. Paid adapters require a license key passed via PAYKIT_LICENSE_KEY environment variable.

Get Started

Ready to simplify your payment stack?

Install PayKit and accept your first payment in minutes. One SDK, every provider.

npm install @squaredr/paykit stripe