sfsso-frappe

Introduction

sso-frappe is a reusable OAuth2/OIDC client for adding "Login with Frappe" to any JavaScript/TypeScript application — and, via a dedicated Composer package, to Laravel.

One package, multiple entry points — each entry point targets a specific environment (browser vs server vs framework adapter). Pick the ones you need; the OAuth core is shared and framework-agnostic.

Supported stacks

Stack Entry point Needs your own backend?
Next.js (App Router + Auth.js v5) sso-frappe/next-auth No — Next.js server handles it
Next.js (custom, no Auth.js) sso-frappe/server No — API routes handle it
Nuxt 3+ sso-frappe/browser + sso-frappe/server Nitro server route (docs show exact setup)
React SPA (Vite/CRA/Next client) sso-frappe/browser Yes — Express/NestJS/Fastify etc.
Vue / Nuxt SPA (client-only) sso-frappe/browser Yes — any JS backend
Svelte / SvelteKit sso-frappe/browser + sso-frappe/server SvelteKit server or your own
Express / Fastify / Koa / Hono / NestJS sso-frappe/server It is the backend
Deno / Bun sso-frappe/server It is the backend
Laravel / PHP sso-frappe-laravel (Composer package — see Laravel guide) Laravel side
Frappe → Frappe No package needed — use Frappe's built-in Social Login Key (guide) None

Entry points

Import Purpose
sso-frappe/server Server-side client. Token exchange with clientSecret, userinfo fetch, discovery. For Node.js backends (Express, NestJS, Nitro, ...).
sso-frappe/browser Browser-safe client. Starts the OAuth flow (state + PKCE + redirect) and validates the callback. Never accepts clientSecret. For SPAs (React, Vue, Svelte, vanilla JS).
sso-frappe/next-auth Auth.js v5 provider config for Next.js.
sso-frappe (root) Shared types, config validator, error classes, validateState.

How to read these docs

  1. Getting Started — how OAuth works here, then create your OAuth client in Frappe.
  2. Guides — identity schema and security requirements.
  3. Frameworks — pick your stack and follow the guide end-to-end.
  4. Reference — API details for the browser and server clients, and the Frappe endpoints the package talks to.

Start with How It Works, then Frappe Provider Setup.