supertokens-web-js
Advanced tools
Changelog
[0.8.0] - 2023-09-25
With this release, we are introducing AccountLinking, this will let you:
Check our guide for more information.
To use this you'll need compatible versions:
createdNewUser
has been renamed to createdNewRecipeUser
createCode
, consumeCode
, createPasswordlessCode
and consumePasswordlessCode
can now return status: SIGN_IN_UP_NOT_ALLOWED
signInAndUp
and thirdPartySignInAndUp
can now return new status: SIGN_IN_UP_NOT_ALLOWED
sendPasswordResetEmail
can now return status: "PASSWORD_RESET_NOT_ALLOWED"
signIn
and emailPasswordSignIn
can now return SIGN_IN_NOT_ALLOWED
signUp
and emailPasswordSignUp
can now return SIGN_UP_NOT_ALLOWED
We've added a generic User
type instead of the old recipe specific ones. The mapping of old props to new in case you are not using account-linking:
user.id
stays user.id
user.email
becomes user.emails[0]
user.phoneNumber
becomes user.phoneNumbers[0]
user.thirdParty
becomes user.thirdParty[0]
user.timeJoined
is still user.timeJoined
user.tenantIds
is still user.tenantIds
// Here res refers to the result the function/api functions mentioned above.
const isNewUser = res.createdNewRecipeUser && res.user.loginMethods.length === 1;
const isNewUser = res.user.loginMethods.length === 1;
Changelog
[0.7.3] - 2023-08-21
clientType
usage in thirdpartypasswordless
Changelog
[0.7.2] - 2023-08-07
clientType
usage in thirdpartyemailpassword
and thirdpartypasswordless
Changelog
[0.7.1] - 2023-07-31
isEmailVerified
and sendVerificationEmail
requestsChangelog
[0.7.0] - 2023-07-19
getTenantIdFromURL
to multiple recipesclientType
config in the input for SuperTokens.init
function, that is used by thirdparty and multitenancy recipes.getAuthorisationURLWithQueryParamsAndSetState
setStateAndOtherInfoToStorage
, getAuthorisationURLFromBackend
, generateStateToSendToOAuthProvider
, verifyAndGetStateOrThrowError
, getAuthCodeFromURL
, getAuthErrorFromURL
, getAuthStateFromURL
getAuthorisationURLWithQueryParamsAndSetState
setStateAndOtherInfoToStorage
, getAuthorisationURLFromBackend
, generateStateToSendToOAuthProvider
, verifyAndGetStateOrThrowError
, getAuthCodeFromURL
, getAuthErrorFromURL
, getAuthStateFromURL
getThirdPartyAuthorisationURLWithQueryParamsAndSetState
setThirdPartyStateAndOtherInfoToStorage
, getAuthorisationURLFromBackend
, generateThirdPartyStateToSendToOAuthProvider
, verifyAndGetThirdPartyStateOrThrowError
, getThirdPartyAuthCodeFromURL
, getThirdPartyAuthErrorFromURL
, getThirdPartyAuthStateFromURL
getAuthorisationURLWithQueryParamsAndSetState
Before:
const authUrl = await ThirdPartyEmailPassword.getAuthorisationURLWithQueryParamsAndSetState({
providerId: "google",
authorisationURL: `${websiteDomain}/auth/callback/google`,
});
After:
const authUrl = await ThirdPartyEmailPassword.getAuthorisationURLWithQueryParamsAndSetState({
thirdPartyId: "google",
frontendRedirectURI: `${websiteDomain}/auth/callback/google`,
});
Before:
const authUrl = await ThirdPartyEmailPassword.getAuthorisationURLWithQueryParamsAndSetState({
providerId: "apple",
authorisationURL: `${websiteDomain}/auth/callback/apple`,
});
After:
const authUrl = await ThirdPartyEmailPassword.getAuthorisationURLWithQueryParamsAndSetState({
thirdPartyId: "apple",
frontendRedirectURI: `${websiteDomain}/auth/callback/apple`,
redirectURIOnProviderDashboard: `${apiDomain}/auth/callback/apple`
});
Changelog
[0.6.0] - 2023-03-14
Changelog
[0.5.0] - 2023-02-01
supertokens-website
dependency that requires a backend SDK update to:
sessionScope
renamed to sessionTokenFrontendDomain
cookieDomain
renamed to sessionTokenBackendDomain
Authorization
header instead of cookies
tokenTransferMethod
config optionChangelog
[0.4.0] - 2023-01-19
cookieHandler
, windowHandler
and sessionClaimValidatorStore
from supertokens-website.getWindowUnsafe
to the WindowHandlerInterface. This function should return the raw window object.Changelog
[0.3.0] - 2022-10-17
addAxiosInterceptors
as deprecatedsuperTokensDoNotDoInterception
to the hash of the request (works as a queryparam as well)maxAgeInSeconds
param of validators to check expiration)