rp
10/30/2021, 4:09 PMimport EmailPassword, {signUp} from "supertokens-node/recipe/emailpassword";
let signUpResponse = await signUp(email, password);
if (signUpResponse.status === "OK") {
// create a new session...
} else {
// the email already exists.. send an appropriate response to the frontend.
}
Note that you will need to call the init
functions for SuperTokens and EmailPassword in your backend for the above to work (See quick setup section here: https://supertokens.io/docs/thirdpartyemailpassword/quick-setup/backend).