https://supertokens.com/ logo
Demo app not working
m

March

05/06/2023, 3:55 PM
Hi, team. I created next.js project with supertokens by running
npx create-supertokens-app@latest
command. After creating project, I ran
npm run dev
. But I am getting
something went wrong
when try signup or signin. What setting do I need more? Please help me. Thank you.
r

rp

05/06/2023, 3:57 PM
Hey @March we will check it out. It should be working. Can you please open an issue about this? Along with any error stack that you are getting on the backend.
m

March

05/06/2023, 3:59 PM
Sure. As I am new for supertokens, I didn't set anything in backend or so. Just ran npx create-supertoeksn-app@latest.
Would you like to guide me kindly how can I set backend or so?
r

rp

05/06/2023, 3:59 PM
Yea. That should use the NextJS api layer
The backend should already be setup and using api folder of the next js app
m

March

05/06/2023, 4:00 PM
This is my code. Is this right?

https://cdn.discordapp.com/attachments/1104436162166263949/1104437654436716624/image.png▾

I didn't change anything.
r

rp

05/06/2023, 4:01 PM
Yes.
I’ll check it out
In terms of if there are any errors
m

March

05/06/2023, 4:01 PM
May I share repository?
r

rp

05/06/2023, 4:02 PM
no need. I can run the cli as well 🙂
ok so the demo app runs fine for me
when you get something went wrong, the CLI must be printing out some error - can you share that please?
m

March

05/06/2023, 4:05 PM
Sure.

https://cdn.discordapp.com/attachments/1104436162166263949/1104438705718051041/image.png▾

r

rp

05/06/2023, 4:05 PM
what about the CLI? Where you ran
npm run dev
do you see any logs there?
m

March

05/06/2023, 4:05 PM

https://cdn.discordapp.com/attachments/1104436162166263949/1104438881681686548/image.png▾

r

rp

05/06/2023, 4:05 PM
hmm
can you social login?
does that work?
m

March

05/06/2023, 4:06 PM
Ah, I see this log.

https://cdn.discordapp.com/attachments/1104436162166263949/1104439060845564048/image.png▾

r

rp

05/06/2023, 4:07 PM
hmm. Im not sure why you are getting this error
whats the connectionURI value?
on the backendConfig.ts file
m

March

05/06/2023, 4:07 PM

https://cdn.discordapp.com/attachments/1104436162166263949/1104439343055126528/image.png▾

r

rp

05/06/2023, 4:07 PM
can you visit that URL on your browser? What do you see?
m

March

05/06/2023, 4:08 PM

https://cdn.discordapp.com/attachments/1104436162166263949/1104439533853999214/image.png▾

r

rp

05/06/2023, 4:08 PM
right. This is odd
try.supertokens.com doesn't require an API key
and it works for me just fine..
m

March

05/06/2023, 4:08 PM
What should I see when visit this url?
r

rp

05/06/2023, 4:09 PM
the response from the browser is fine
whats strange is that when the SDK queries it, it complains about bad api key
can you visit this url on your browser
https://try.supertokens.com/apiversion
?
m

March

05/06/2023, 4:10 PM

https://cdn.discordapp.com/attachments/1104436162166263949/1104439965976379463/image.png▾

r

rp

05/06/2023, 4:10 PM
right so this works as expected
can you sign up on supertokens.com, and get your own connectionuri and api key and use that instead of using try.supertokens.com? Does that work?
m

March

05/06/2023, 4:11 PM
Okay, let me try. Just a minute.
I inserted connectionURI, But I am not sure where should I put apiKey.

https://cdn.discordapp.com/attachments/1104436162166263949/1104440946940182538/image.png▾

r

rp

05/06/2023, 4:14 PM
right next to connectionURI
inside the
supertokens: {..}
object
m

March

05/06/2023, 4:15 PM

https://cdn.discordapp.com/attachments/1104436162166263949/1104441240172367882/image.png▾

r

rp

05/06/2023, 4:15 PM
yup
does this work?
(Also, you might want to change your API key since you exposed it here)
m

March

05/06/2023, 4:16 PM
Phew. Works fine, I think.

https://cdn.discordapp.com/attachments/1104436162166263949/1104441603709476966/image.png▾

What should I do for this?
r

rp

05/06/2023, 4:17 PM
see on the dashboard. There is a button to add an API key
anyway, good that this works. It's really strange that try.supertokens.com didn't work for you..
m

March

05/06/2023, 4:18 PM
I am really thanks for your kind support.
👍
r

rp

05/06/2023, 4:21 PM
Happy to help 🙂
m

March

05/06/2023, 7:17 PM
Hi,
npx create-supertokens-app@latest
is creating TS project. how can I create js project?
r

rp

05/07/2023, 5:52 AM
Hey. Not really. Our demo apps are in ts. You can convert it to js yourself though. Just remove the types