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.
Try it live
Real Stripe & Razorpay test payments. Pick a provider manually or let PaymentRouter choose based on currency.
One API. Any provider.
PayKit sits between your app and payment providers. The adapter pattern lets you swap providers by changing a single line.
// Only this line changes: import { StripeAdapter } from '@squaredr/paykit/stripe';
Kill the spaghetti code
Replace provider-specific branches with a single, clean interface.
lines of boilerplate eliminated
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.
Adapters for every provider you need
Stripe, Razorpay, and PayPal adapters are free forever. Additional providers are available as paid adapter bundles.
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.
Build it yourself
- Separate SDK per provider
- Custom type definitions
- Manual webhook parsing
- Provider-specific error handling
- Rewrite when switching providers
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
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
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 frontendFree core. Pay only for extra providers.
Stripe, Razorpay, and PayPal are free forever. Need more providers? Grab a bundle — one-time purchase, no subscriptions.
All adapters ship in @squaredr/paykit. Paid adapters require a license key passed via PAYKIT_LICENSE_KEY environment variable.
Ready to simplify your payment stack?
Install PayKit and accept your first payment in minutes. One SDK, every provider.
npm install @squaredr/paykit stripe