
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
supertokens-web-js
Advanced tools
This is a plain Javascript SDK that provides the login functionality with SuperTokens.
Learn more at https://supertokens.com
To see documentation, please click here.
Please refer to the CONTRIBUTING.md file in this repo.
For any queries, or support requests, please email us at team@supertokens.com, or join our Discord server.
Created with :heart: by the folks at SuperTokens.com.
[0.10.0] - 2024-03-03
With this release, we are introducing MultiFactorAuthentication and TOTP, this will let you:
Check our guide for more information.
MultiFactorAuth
and TOTP
recipes. To start using them you'll need compatible versions:
firstFactors
into the return type of getLoginMethods
and removed the enabled flags of different login methods.
validatorId
in claim validation errors to id
to match the backend SDKsIf you used to use the enabled flags in getLoginMethods:
Before:
async function checkLoginMethods() {
const loginMethods = await Multitenancy.getLoginMethods();
if (loginMethods.thirdParty.enabled) {
// custom logic
}
if (loginMethods.emailPassword.enabled) {
// custom logic
}
if (loginMethods.passwordless.enabled) {
// custom logic
}
}
After:
async function checkLoginMethods() {
const loginMethods = await Multitenancy.getLoginMethods();
if (loginMethods.firstFactors.includes("thirdparty")) {
// custom logic
}
if (loginMethods.firstFactors.includes("emailpassword")) {
// custom logic
}
if (
loginMethods.firstFactors.includes("otp-email") ||
loginMethods.firstFactors.includes("otp-phone") ||
loginMethods.firstFactors.includes("link-email") ||
loginMethods.firstFactors.includes("link-phone")
) {
// custom logic
}
}
If you used to use the validatorId
prop of validationErrors, you should now use id
instead.
Before:
async function checkValidators() {
const validationErrors = await Session.validateClaims();
for (const error of validationErrors) {
console.log(error.validatorId, error.reason);
}
}
After:
async function checkValidators() {
const validationErrors = await Session.validateClaims();
for (const error of validationErrors) {
console.log(error.id, error.reason);
}
}
FAQs
SuperTokens SDK for vanilla JS for all recipes
The npm package supertokens-web-js receives a total of 20,816 weekly downloads. As such, supertokens-web-js popularity was classified as popular.
We found that supertokens-web-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.