SuperTokens Web JS SDK

Vanilla JavaScript frontend SDK for adding SuperTokens authentication to any web app.

SDK
npm
v0.16.0
70stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
38/100Needs Attention
Development Activity0
Maintenance32
Community44
Maturity56
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture78
Code Quality72
Innovation72
Learning Curve66

supertokens-web-js is the framework-agnostic browser SDK for SuperTokens, an open-source authentication solution. It provides the client-side building blocks for SuperTokens auth recipes — email/password, passwordless, social login, session management and more — as plain JavaScript functions you can call from any front end. It handles session tokens, automatic token refresh and the request interception needed to keep a user authenticated, without tying you to a specific UI framework.

What You Get

  • Client functions for email/password, passwordless and social login recipes
  • Automatic session management with silent access-token refresh
  • Request interception so authenticated calls carry the right tokens
  • A framework-agnostic API usable from React, Angular, Vue or vanilla JS
  • Recipe-based initialisation matching the SuperTokens backend model

Common Use Cases

  • Adding email/password or passwordless login to a single-page app
  • Managing and refreshing user sessions in the browser
  • Wiring social sign-in flows against a SuperTokens backend

Under The Hood

Architecture - The SDK is organised around SuperTokens recipes. You initialise it with the recipes your app uses, and each recipe exposes client functions for its flows. A session layer manages access and refresh tokens and intercepts outgoing requests so authenticated calls carry valid tokens and refresh silently when needed.

Tech Stack - Written in TypeScript and compiled to a browser bundle with webpack; the vanilla-JS output underpins the React, Angular and Vue wrappers. Tests run via mocha.

Code Quality - The library is typed and modular with per-recipe structure, unit tests under test/, and CI scripts. As a client SDK it depends on a compatible SuperTokens backend for end-to-end behaviour.

API Design - The recipe-based API mirrors the backend model, which is coherent once understood but assumes familiarity with SuperTokens concepts. Framework-agnostic design is a strength; initial setup requires wiring recipes to match the backend.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search