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
- Plain JavaScript
- React Native
import SuperTokens from "supertokens-auth-react";
SuperTokens.init({ appInfo: { appName: "yourAppName", apiDomain: "yourApi", websiteDomain: "yourWebsite", websiteBasePath: "/authentication" }, recipeList: [],});
Now, if you navigate to /authentication
, you should see the widget.
Not applicable
- This feature doesn't apply to the
supertokens-website
SDK. - Please also ignore step 2) for this.
Not applicable
- This feature doesn't apply to the
supertokens-react-native
SDK. - Please also ignore step 2) for this.
#
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=[ #... ])