auth · authz · consent — for bharat

Authentication that
actually fits India.

WhatsApp-first OTP, passkeys, social login and a full RBAC engine — with DPDP consent and one-prompt AI integration. Free auth, BYO gateways, pay only for the messages you send.

Start buildingSee pricing — it's free
$ npm i @nexauth/sdk   ·   live in under 5 minutes
login.ts
import NexAuth from "@nexauth/sdk";

const auth = new NexAuth({
  publishableKey: "pk_live_...",   // from dashboard
});

// WhatsApp OTP — one call, done.
await auth.otp.send({ channel: "whatsapp", to: "+91 98XXXXXX01" });
const session = await auth.otp.verify({ channel: "whatsapp",
  to: "+91 98XXXXXX01", code: "123456" });

// session.access_token → RS256 JWT, verify offline via JWKS

Every method your users already use

WhatsApp OTP₹0.35 / msg
SMS OTP₹0.40 / msg
Email / Magic link₹0.10 / msg
Voice OTP₹0.80 / call
Passkeysfree
Google / Socialfree
TOTP 2FAfree
Passwordfree

Prices are pass-through messaging costs. BYO gateway = ₹0 per send.

the platform

Auth + authorization + consent.
One integration.

Authentication

OTP on WhatsApp/SMS/email/voice, passkeys, social, magic links, passwords, QR — all behind one session model with per-tenant RS256 JWTs.

Authorization

RBAC free forever — roles, permissions, resource-scoped assignments, server-side checks. What Auth0 charges for, bundled.

DPDP consent

Purpose-level consent records, withdrawal, Data Principal rights APIs, hash-chained tamper-evident audit trail. Compliance as a feature, not a scramble.

Migration

Bulk import with bcrypt/argon2/scrypt/Firebase-scrypt adapters — users keep their passwords. Lazy migration on next login. Zero reset emails.

Federation

Keep Firebase/Supabase/Auth0 — add Bharat channels + DPDP on top. Or replace them entirely. Your call, per environment.

AI-native

MCP server, llms.txt, installable skill — one prompt and your AI agent wires the whole integration.

bring your own gateway

Already have MSG91 or Gupshup? Keep it.

Nobody else in this market lets you plug in your own SMS/WhatsApp/email provider credentials. NexAuth bills a flat platform fee — your gateway contract stays yours, at your negotiated rates, with your delivery reports.

  • → Encrypted at rest (AES-256-GCM), tenant-scoped
  • → BYO wins → else platform gateway → else hard error, never silent fallback
  • → BYO sends cost ₹0 in credits
put-gateway.json
PUT /v1/admin/gateways/2factor
Authorization: Bearer sk_live_...

{
  "credentials": { "api_key": "••••••••", "otp_template": "SIGNIN_OTP" },
  "enabled": true
}

→ all sms OTPs now route through YOUR 2Factor account
→ 0 credits consumed
sdks

First-class SDKs, not wrappers.

Start free. Stay free.

Unlimited users, all auth methods, all SDKs — ₹0. Credits only when you send messages.

Create your first appRead the quickstart