SuperTokens Web JS SDK
Vanilla JavaScript frontend SDK for adding SuperTokens authentication to any web app.
Repository Health
Technical Analysis
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.
Used by 2 apps in this directory
agenta
Developer Tools · Devops · AI Development
The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.
GraphQL Hive
Developer Tools · Devops · Monitoring
Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.