Skip to main content

Setting default country for phone inputs

What type of UI are you using?

How do you identify your users?

By default, there is no default country selected. This means that users will have to select / type in their phone number internation code when signing in / signing up.

If you would like to set a default country (for all users), then you should use the defaultCountry config:

import SuperTokens from "supertokens-auth-react";
import Passwordless from "supertokens-auth-react/recipe/passwordless";
import Session from "supertokens-auth-react/recipe/session";

SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [
Passwordless.init({
contactMethod: "PHONE",
signInUpFeature: {
/*
* Must be a two-letter ISO country code (e.g.: "US")
*/
defaultCountry: "HU",
}
}),
Session.init({ /* ... */ })
]
});