https://supertokens.com/ logo
j

joeldesante

04/12/2022, 4:03 AM
Any ideas?
r

rp

04/12/2022, 4:03 AM
Any ideas?
Hey!
Use this thread @User @User
j

joeldesante

04/12/2022, 4:04 AM
Ive been manually hitting endpoints through the browser
n

nkshah2

04/12/2022, 4:04 AM
Just to clarify, you’ve hosted the SuperTokens core yourself but haven’t used any backend sdk yet?
r

rp

04/12/2022, 4:04 AM
Are you querying your frontend url or backend url?
Not sure what you mean by that
Im querying supertokens directly right now
r

rp

04/12/2022, 4:05 AM
The core?
Please see the architecture diagram
j

joeldesante

04/12/2022, 4:05 AM
One moment, let me take a look
r

rp

04/12/2022, 4:06 AM
And setup the frontend / backend SDKs
There are two sets of APIs
One for the core, and one exposed by the backend SDK
j

joeldesante

04/12/2022, 4:07 AM
Right so
Im trying to ping the bottom part there
r

rp

04/12/2022, 4:07 AM
Not sure what you mean by bottom
Left or right?
j

joeldesante

04/12/2022, 4:08 AM
the second one in the "Your Backend API" section
the lower one
n

nkshah2

04/12/2022, 4:08 AM
So there’s three parts to using SuperTokens, you need the core which you have hosted yourself
j

joeldesante

04/12/2022, 4:08 AM
right
n

nkshah2

04/12/2022, 4:08 AM
You need the backend sdk that exposes the APIs to you
Which is the middle bit you’re trying to query
j

joeldesante

04/12/2022, 4:09 AM
So the SDK is what lets me programmatically access supertokens. RIght?
n

nkshah2

04/12/2022, 4:09 AM
And exposes api routes on your server (to call things like /auth/signin etc)
j

joeldesante

04/12/2022, 4:10 AM
Right, but why cant I just make a request to the core directly?
It's just a rest api right?
j

joeldesante

04/12/2022, 4:11 AM
Right now Im using the Signin/Signup recipe and Im getting 404s with that too
n

nkshah2

04/12/2022, 4:11 AM
That’s the spec for APIs exposed by the core, if you wanted to call it manually
j

joeldesante

04/12/2022, 4:11 AM
Yea, so Im looking at that and Im getting 404's
n

nkshah2

04/12/2022, 4:12 AM
The URL you sent earlier doesn’t match the spec
j

joeldesante

04/12/2022, 4:12 AM
That may be the issue. Let me relook at that
n

nkshah2

04/12/2022, 4:13 AM
Also while you can query the core directly, I highly recommend using one of the backend sdks. It makes the whole process much simpler
j

joeldesante

04/12/2022, 4:13 AM
Right, thats the plan
n

nkshah2

04/12/2022, 4:13 AM
But for testing you can use that spec
j

joeldesante

04/12/2022, 4:13 AM
But I need to figure out why its not responding with anything
I looked at the spec. Seems to match
How would you change it to match?
n

nkshah2

04/12/2022, 4:15 AM
Right so that’s a different spec
That’s the spec for the frontend to query the backend sdk
The one I sent is the spec for communicating with the core
If you look at both, the routes are different
j

joeldesante

04/12/2022, 4:15 AM
Oml. Okay so I clicked the link you gave me and Im getting responses now.
Thats a bit confusing
n

nkshah2

04/12/2022, 4:16 AM
Like I said there’s 3 parts to SuperTokens in most cases, so 2 specs for the two pairs
j

joeldesante

04/12/2022, 4:16 AM
So then I guess what I dont understand is what is the frontend doing? Because it is querying something and getting 404s
I clearly misconfigured something
n

nkshah2

04/12/2022, 4:17 AM
So you hosted the core, which your backend communicates with
j

joeldesante

04/12/2022, 4:17 AM
So there are 3 restful API's?
or 3 parts generally
n

nkshah2

04/12/2022, 4:17 AM
3 parts but 2 sets of APIs - between your backend and the core (the one I sent) - between the frontend and the backend (the one you sent)
j

joeldesante

04/12/2022, 4:18 AM
Ah okay. I see
Why was it designed this way? Just curious.
n

nkshah2

04/12/2022, 4:19 AM
Out of curiosity what part of the architecture diagram confused you in this setup? So we can improve on it
j

joeldesante

04/12/2022, 4:19 AM
If Im being honest, the documentation overall was really unclear
n

nkshah2

04/12/2022, 4:20 AM
Hmm, we would love to hear some specifics. I do agree things can be improved but hard to do that without feedback :p
j

joeldesante

04/12/2022, 4:21 AM
In this image it isnt clear what is happening to me.
All im seeing is that there are some endpoints
r

rp

04/12/2022, 4:22 AM
Did you see the diagram below?
And walk through how that works?
j

joeldesante

04/12/2022, 4:22 AM
The sign in and sign out flow?
r

rp

04/12/2022, 4:22 AM
Yes
j

joeldesante

04/12/2022, 4:23 AM
I havnt even looked at it yet.
I didnt realize that I should have looked at it
r

rp

04/12/2022, 4:23 AM
Hmm.
n

nkshah2

04/12/2022, 4:23 AM
Yep that’s probably where the confusion comes from, something we need to iterate on for sure then
Thanks for the feedback!
j

joeldesante

04/12/2022, 4:25 AM
So after looking at the second chat. The system makes more sense. But Im confused, what exactly is a "session" in this case?
I assume it's different from sessions in PHP?
n

nkshah2

04/12/2022, 4:27 AM
It’s just a conventional session, the best way to look at it is that your backend systems are split into the backend sdk and the core
j

joeldesante

04/12/2022, 4:27 AM
Right, so the whole system is stateless then?
holly molly
it works
thanks!
r

rp

04/12/2022, 4:44 AM
Yes. It is.