Skip to main content

Request data

Access information about the visitor's request to the server with useRequestData.

import { useRequestData } from "@instantcommerce/sdk";

const {
/**
* Country code in ISO 3166-1 Alpha 2 format.
*
* In case the country could not be determined, the value will be "XX".
* In case the visitor is on the TOR network, the value will be "T1".
*
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
country,
/**
* Unicode locale identifier
* @see https://www.unicode.org/reports/tr35/#Unicode_locale_identifier
*/
locale,
} = useRequestData();