https://supertokens.com/ logo
Title
c

CodeX

02/19/2023, 10:39 AM
Hi, is it possible to run my website on a one domain assigned to a hosting and the Supertokens Core on a different domain assigned to a completely different VPS?
r

rp

02/19/2023, 11:02 AM
Hey @CodeX
Yes. It is. The frontend never talks to the core directly
c

CodeX

02/19/2023, 1:11 PM
Alright, is it possible to serve the login page on the same domain as the website?
r

rp

02/19/2023, 1:20 PM
Yup. That’s the default way of using supertokens.
Have a look at our demo apps / guides please.
c

CodeX

02/19/2023, 1:24 PM
I did look
I think I'm getting closer to solving my issue, but there's one more thing, I'd like to ask
r

rp

02/19/2023, 1:25 PM
Sure.
c

CodeX

02/19/2023, 1:27 PM
Backend (my VPS) runs PostgreSQL locally, so if I wanted to reach it from any other device, I need to use SSH Tunneling, I assume it's correct - for security reasons, right? Also, when I specify the
apiDomain
in the backend code - should I provide a localhost address or the VPS IP address?
Whooops, the apiDomain is on the frontend as well 🤦‍♂️ so I should provide there my VPS's IP address, right?
r

rp

02/19/2023, 1:30 PM
> Backend (my VPS) runs PostgreSQL locally, so if I wanted to reach it from any other device, I need to use SSH Tunneling, I assume it's correct - for security reasons, right? Im not sure. apiDomain is on the backend and the frontend. The value of this should be the same as what your frontend uses when querying your APIs. For example, it could be localhost:8081 or something if your API process if listening on that.
c

CodeX

02/19/2023, 1:32 PM
Hmm, so if after clicking
login
the page goes to https://{mywebsite}/auth, then this link should be passed in, right?
r

rp

02/19/2023, 1:32 PM
I’m not sure what you mean by passed on
Do you have an api layer / process running?
c

CodeX

02/19/2023, 1:34 PM
Hmm, I'm running supertokens (I've executed
supertokens start
) and I'm running the backend code (I assume this is the API)
and, frontend page (on another hosting)
r

rp

02/19/2023, 1:35 PM
Yea. So what’s the address that the backend is listening on?
c

CodeX

02/19/2023, 1:39 PM
Backend (VPS): Supertokens is running here: http://localhost:3567 apiDomain: "http://localhost:3001", websiteDomain: (i don't want to make it public now) but it's an address of frontend homepage: "https://{mywebsite}"
r

rp

02/19/2023, 1:39 PM
Right yea. This seems fine
So the login page will be built on your website domain/auth route
And that will call APIs exposed by our backend SDK on localhost:3001
c

CodeX

02/19/2023, 1:41 PM
oh, and the login page appears on "https://{mywebsite}/auth"
is that right?
r

rp

02/19/2023, 1:44 PM
Yes
c

CodeX

02/19/2023, 1:45 PM
Thanks a million!