To use the site module, import wixSiteFrontend
from the wix-site-frontend
module:
import wixSiteFrontend from "wix-site-frontend";
The APIs in wix-site-frontend
can only be used in front-end code.
Gets a code representing the site's currency.
The retrieved currency code corresponds to the currency that has been entered in the General Info section of your site's Dashboard.
The currency is used your site, apps (e.g. Wix Stores, Wix Bookings), and other Wix features.
import wixSiteFrontend from "wix-site-frontend";
// ...
const currency = wixSiteFrontend.currency; // "USD"
Gets information about the current page or lightbox.
import wixSiteFrontend from "wix-site-frontend";
// ...
const currentPage = wixSiteFrontend.currentPage;
/*
* {
* "name": "Home",
* "type": "static",
* "url": "/home",
* "isHomePage": true
* }
*/
Gets a code representing the site's language.
The retrieved language code corresponds to the main site language as found in the General Info section of your site's Dashboard.
Note: If you have a multilingual site, and it is being viewed in a language
that is not the main site language, the language
property still returns
the main site language. To work with the languages of a multilingual site,
use the Multilingual API.
import wixSiteFrontend from "wix-site-frontend";
// ...
const language = wixSiteFrontend.language; // "en"
Gets the site's regional settings.
The retrieved regional settings corresponds to the regional settings that has been entered in the General Info section of your site's Dashboard.
The regional settings are used to determine how numbers, dates, and currencies are displayed on your site.
import wixSiteFrontend from "wix-site-frontend";
// ...
const regionalSettings = wixSiteFrontend.regionalSettings; // "en-us"