Better Auth plugin · Nuvion
One payment, a share for every parent.
Accept Nuvion payments from your Better Auth app and split each one across your platform, resellers and merchants, with retries, refunds and signed webhooks built in.
Version 0.1 · pre-release · npm i @umohpyro/better-auth-nuvion · Nuvion sandbox
import { nuvion } from "@umohpyro/better-auth-nuvion";
export const auth = betterAuth({
plugins: [
organization(),
nuvion({
apiKey: process.env.NUVION_API_KEY!,
webhookSecret: process.env.NUVION_WEBHOOK_SECRET!,
}),
],
});
const { data } = await authClient.nuvion.payments({
organizationId: merchant.id, amountMinor: 10_000, currency: "GBP",
redirectUrl: "https://shop.example.com/done",
});
// data.checkoutUrl, data.chargedMinor, data.legsMulti-level merchants
Platform, reseller and merchant in one tree. A payment cascades from the child to every parent.
Flexible fees
Flat, basis points, minimum, cap, and who bears it. Integer money; the legs always sum to the charge.
Safe by construction
Signed webhooks, de-duplication, and an idempotent executor that retries without paying twice.
Counterparties handled
The Nuvion counterparty and payment detail for each transfer are created the first time they are needed.
Retry and refund
Re-run failed legs, or reverse a split with reversal legs back to the merchant.
Typed end to end
authClient.nuvion.* is typed from the server schema, so a wrong call fails tsc.
These docs cover the plugin only. For the Nuvion API itself, see the Nuvion API documentation.