https://supertokens.com/ logo
#support-questions
Title
# support-questions
c

constantinos

06/19/2022, 10:58 AM
Hello, I am trying to call
SuperTokens.consumeCode()
but I get
consumeCode is not a function
Is there a difference with calling
/signinup/code/consume
directly? Because this works.
r

rp

06/19/2022, 10:59 AM
Hey! How are you importing?
Hey! How are you importing?
c

constantinos

06/19/2022, 4:11 PM
> import SuperTokens from 'supertokens-website'; > SuperTokens.consumeCode() Is there a special way to import it?
r

rp

06/19/2022, 4:12 PM
oh right. So this function is not available in the supertokens-website SDK. This SDK is only useful for session management.
So you will have to make the API call using
axios
or
fetch
.
c

constantinos

06/19/2022, 4:14 PM
Is this not the reference for supertokens-website? > https://supertokens.com/docs/web-js/modules.html
r

rp

06/19/2022, 4:15 PM
no. this is another SDK -> supertokens-web-js
you can use that instead of supertokens-website, but we haven't added any docs for it yet
Once we add docs for it, then you no longer need to use supertokens-website since that will be a part of the supertokens-web-js SDK.
c

constantinos

06/19/2022, 4:18 PM
ok thanks
r

rp

06/19/2022, 4:18 PM
i mean you can use the supertokens-web-js SDK if you like.
but you might find it a little difficult given that there are no docs for it yet.
c

constantinos

06/19/2022, 4:19 PM
Yes I understand.