https://supertokens.com/ logo
Api base path
k

kumkee

03/22/2023, 5:47 PM
Hi, if my backend API url is not in the root path, for example, https://mydomain.dev/api, how do I set it up for SuperTokens? I remember reading some where in the docs that I need an extra step, but I can't remember
r

rp

03/23/2023, 2:18 AM
Hey @kumkee
You need to set the apiBasePath on the backend and frontend SDK in appInfo to “/api/auth”
Do you have a reverse proxy on the backend which strips away the “/api” part?
k

kumkee

03/23/2023, 3:55 AM
I don't have a proxy. My frontend and backend use the same domain. Frontend is at "`/`" backend at "`/api`"
So I can't set both to the same value.
r

rp

03/23/2023, 6:08 AM
you don't need to set the same values for both. websiteBasePath can be
/auth
, and apiBasePath can be
/api/auth
k

kumkee

03/23/2023, 5:26 PM
With that, my
/api/auth/dashboard
returns a blank page. I am using FastAPI as my backend.
r

rp

03/23/2023, 6:08 PM
Do you see any errors on the browser’s console log when navigating to that page?