The Authentication Toolkit for TypeScript

@warpy-auth-sdk/core is a free open-source library that gives you the tools you need to build secure authentication with AI agent integration.

npm i @warpy-auth-sdk/core

Trusted by builders at

LERIO
SOURCEPILOT
Multiple Auth Methods
OAuth 2.0, email magic links, and custom providers. Switch between providers with a single line of code.
AI Agent Authentication
Revolutionary MCP support for AI agents to authenticate on behalf of users with scoped access.
Framework-agnostic
Build with React, Next, Vue, Nuxt, SvelteKit, and more. Works with any Node.js framework.
TypeScript First
Full type safety throughout with intelligent autocomplete and compile-time error checking.
Security Built-in
CSRF protection, JWT sessions, token revocation, and scope-based access control out of the box.
Database Adapters
Prisma adapter included. Extensible adapter system for any database or ORM.

Get started in minutes

Simple, powerful authentication that scales with your application

// proxy.ts
import { authMiddleware } from "@warpy-auth-sdk/core/next";
import { google } from "@warpy-auth-sdk/core";

const handler = authMiddleware({
  secret: process.env.AUTH_SECRET!,
  provider: google({
    clientId: process.env.GOOGLE_CLIENT_ID!,
    clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
    redirectUri: process.env.GOOGLE_REDIRECT_URI!,
  }),
  callbacks: {
    async user(u) {
      // Resolve/upsert your user
      return { id: u.id, email: u.email, name: u.name };
    }
  }
});

export function proxy(request: NextRequest) {
  const p = request.nextUrl.pathname;
  if (p.startsWith("/api/auth")) return handler(request);
  return NextResponse.next();
}