Interfaces
CountryDetectionParams
Properties
ModuleOptions
Properties
UseCountryDetectionReturn
Properties
| Property | Type | Description |
|---|---|---|
detectedRegion | Readonly<Ref<... | ...>> | The detected region code (based on the user's location, e.g "US") |
hasPromptedUser | ComputedRef<boolean> | A computed reference indicating whether the user has already been prompted to switch shops (persisted in session storage). |
hasSwitchedShops | ComputedRef<boolean> | A computed reference indicating whether the user has already manually switched shops (persisted in session storage). |
markShopAsSwitched | () => void | A function to mark that the user has manually switched shops. Marking the shop as changed will prevent the user from being prompted to switch shops again. |
markUserAsPrompted | () => void | A function to mark that the user has been prompted to switch shops. |
suggestedShops | ComputedRef<PublicShopConfig> | An array of shops matching the detected region or the fallback shop. |
suggestionActive | Readonly<Ref<boolean>> | A boolean indicating whether a suggestion for switching shops should be active. |
Variables
module
Functions
useCountryDetection()
A composable that provides logic for detecting the user's country and suggesting shops matching the detected country.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | CountryDetectionParams | An object containing the parameters for the composable. |
Returns
An object containing reactive data, computed properties and functions for managing country detection: