Looking at the docs so far has been great. I am wondering if there's a way to add users without sign...
w
Looking at the docs so far has been great. I am wondering if there's a way to add users without signing up? Looking to use an API instead once they sign up through our Stripe checkout.
I'll be using it for passwordless with SMS
r
yes there is - which backend SDK are you using?
for example, you can use the passwordless.signInUp function from our node SDK https://supertokens.com/docs/nodejs/modules/recipe_passwordless.html#signInUp
w
@rp_st thanks for your help on this. I am setting up Netlify and now up to stage to test front end but getting 500 response on netlify functions, saying
Please call the supertokens.init function before using SuperTokens
r
as the error says, please call the init function.
w
I'm following the code from docs, is it this init function on line 7?
r
yes
but you need to make sure that you are calling init on the right recipes
compared to the ones that you are using
w
in the supertokensConfig I am importing Passwordless and Session:
Copy code
let Passwordless = require("supertokens-node/recipe/passwordless");
let Session = require("supertokens-node/recipe/session");
is that what you mean?
r
right yea
So when you get Please call the supertokens.init function before using SuperTokens, whats the full error stack?
w
I just restarted the server and it appears to be working now, very strange, I was able to test getting a OTP with this method on the front end:
Copy code
async createCode() {
      console.log("create code");
      try {
        let response = await createCode({
            phoneNumber: "###"
        });

        // Magic link sent successfully.
        window.alert("Please check your email for the magic link");
    } catch (err) {
        if (err.isSuperTokensGeneralError === true) {
            // this may be a custom error message sent from the API by you,
            // or if the input email / phone number is not valid.
            window.alert(err.message);
        } else {
            window.alert("Oops! Something went wrong.");
        }
    }    
    }
thanks, I will let you know if I get the error again but hopefully you don't hear from me again!
r
cool
w
it's looking promising so far, hopefully I can ditch Auth0 which we currently use that has a 3 day inactivity timeout
r
what do you mean by -> "3 day inactivity timeout"?
w
@rp_st Auth0 automatically logs users out of session after 3 days of inactivity, we have an app that uses access once a week (a weekly publication) so users are logged out everytime they access and have to log in again. Based on what I have seen from SuperTokens documentation, the inactivity timeout is 100 days? https://supertokens.com/docs/session/common-customizations/sessions/change-session-timeout
r
I see.
Yea correct - 100 days inactivity timeout indeed.