Country Code Configuration
Setting a default country code for your eBroker web application helps streamline the user experience when entering phone numbers for registration, login, or contact purposes.
Setting Default Country Code
- Open the
.env
file in your project's root directory - Locate the default country code variable
- Set it to your preferred country code (e.g., "IN" for India, "US" for the United States)
Why Set a Default Country Code?
Setting a default country code offers several benefits:
- It streamlines the phone number entry process for users
- It pre-fills the country code dropdown in phone input fields
- It helps ensure phone numbers are stored in a consistent format
- It improves the user experience for your primary target audience
Country Code Format
When setting the country code, use the two-letter ISO country code (ISO 3166-1 alpha-2) in uppercase:
- ✅ Use:
IN
(for India) - ✅ Use:
US
(for United States) - ❌ Don't use:
in
,us
(lowercase) - ❌ Don't use:
+91
,91
(numeric codes)
Find Your Country Code
You can find a comprehensive list on the Google Developers site: Country Codes List.
Testing the Default Country Code
After setting the default country code:
- Save the
.env
file - Restart your development server
- Go to a page with a phone number input field (e.g., registration or login)
- Verify that the correct country code is pre-selected
If the country code is not appearing correctly, double-check your .env
file configuration and ensure you've restarted your development server after making changes.