SuperTokens integration error in React JS project
# general
u
SuperTokens integration error in React JS project
I tried to integrate SuperTokens in my React JS project. I used the email and password recipe. When I tried to sign up, then the error showed up. I used the managed service.
n
Hey @᲼᲼᲼᲼ , Do you have a backend server (using the SuperTokens backend SDK) running?
u
I just created the server inside React JS project, named
api-server.js
n
And just to confirm, it is running and is started on port 3001 correct?
u
Yeah, right. One more thing. I'm confused about the server is running or not.
When I tried to run the server in browser in port 3001, it says the site can't be reached.
n
First things first please delete the last screenshot you sent (it contains your API key) Im not sure what you mean by that, your api-server needs to be run separately
node api-server.js
for example
u
Separately means separate project?
n
So running
npm run start
in your React app will just start the frontend. You need to run your backend as well
u
How can I will run the server?
n
Try this
node api-server.js
u
I'm facing this error. Import isn't working.
n
Right I would recommend looking up how to set up and start running an express server for this
u
Okay
Can you please provide me reference?
n
Following the express guides should help
u
Okay
Can you provide any documentation for Vue JS?
n
Our auth-react SDK does not support Vue JS, you can use
supertokens-web-js
(exposes functions that you can use to call our APIs) and build your own UI on top of it
u
Got it.
Thanks
n
You can also use our React SDK to host your auth UI independent of your VueJS app. That way you can use our pre built UI for the auth forms Our docs mention how to do this for Angular but the same applies for Vue as well For example if you were using the Passwordless recipe you can refer to this: https://supertokens.com/docs/passwordless/quick-setup/frontend
7 Views