Website Base Path
#
Step 1) Front End ChangeSince the beginning of this guide, you probably noticed that all the front-end routes for SuperTokens widget are prefixed by /auth
. You can change this value in the init
function by setting websiteBasePath
.
- ReactJS
- Angular
- Vue
Important
SuperTokens does not provide non-React UI components. So we will be using the
supertokens-auth-react
SDK and will inject the React components to show the UI. Therefore, the code snippet below refers to the supertokens-auth-react
SDK.import SuperTokens from "supertokens-auth-react";
SuperTokens.init({
appInfo: {
appName: "yourAppName",
apiDomain: "yourApi",
websiteDomain: "yourWebsite",
websiteBasePath: "/authentication"
},
recipeList: [],
});
Important
SuperTokens does not provide non-React UI components. So we will be using the
supertokens-auth-react
SDK and will inject the React components to show the UI. Therefore, the code snippet below refers to the supertokens-auth-react
SDK.import SuperTokens from "supertokens-auth-react";
SuperTokens.init({
appInfo: {
appName: "yourAppName",
apiDomain: "yourApi",
websiteDomain: "yourWebsite",
websiteBasePath: "/authentication"
},
recipeList: [],
});
import SuperTokens from "supertokens-auth-react";
SuperTokens.init({
appInfo: {
appName: "yourAppName",
apiDomain: "yourApi",
websiteDomain: "yourWebsite",
websiteBasePath: "/authentication"
},
recipeList: [],
});
#
Step 2) Back End ChangeYou also need to change the websiteBasePath
in your backend code:
- NodeJS
- GoLang
- Python
import SuperTokens from "supertokens-node";
SuperTokens.init({
appInfo: {
appName: "yourAppName",
apiDomain: "yourApi",
websiteDomain: "yourWebsite",
websiteBasePath: "/authentication"
},
recipeList: [],
});
import "github.com/supertokens/supertokens-golang/supertokens"
func main() {
websiteBasePath := "/authentication"
supertokens.Init(supertokens.TypeInput{
AppInfo: supertokens.AppInfo{
AppName: "yourAppName",
APIDomain: "yourApi",
WebsiteDomain: "yourWebsite",
WebsiteBasePath: &websiteBasePath,
},
})
}
from supertokens_python import init, InputAppInfo
init(
app_info=InputAppInfo(
app_name='yourAppName',
api_domain='yourApi',
website_domain='yourWebsite',
website_base_path='/authentication'
),
framework='...',
recipe_list=[
#...
]
)