What you get
The plugin is split into three parts: a server plugin, a client plugin, and an optional React hooks package. The server plugin registers endpoints under your Better Auth handler. The client plugin exposes typed methods on your auth client. The React hooks wrap those methods with TanStack Query for caching and loading states.One-time payments
Create orders, capture payments, and verify signatures.
Subscriptions
Manage recurring billing, upgrades, pauses, and cancellations.
Organizations
Bill teams and sync seat counts with member changes.
Webhooks
Handle Razorpay events with built-in signature verification.
React hooks
Query and mutate payments and subscriptions from React.
API reference
Browse every endpoint and parameter.
Requirements
- Better Auth
^1.7.0 - TypeScript
^5.6.3 - A Razorpay account with API keys
- Optional:
@tanstack/react-query ^5.104.3andreact ^19.3.0if you use the React hooks
Quick teaser
Add the server plugin to your auth config:auth.ts
client.ts