Skip to main content

Store, Device & Config

store: Store

Information about the current store, such as its domain, currency, and language.

PropertyTypeAlways presentDescription
idnumberYesUnique identifier for the store.
namestringYesName of the store.
domainstringYesDomain name associated with the store.
currencystringYesDeprecated. Currency code. Use currency_details.code instead.
currency_detailsCurrencyDetailsYesCurrency used by the store, including its formatting rules.
language"es" or "pt" or "en"YesLanguage code of the store.
themestringYesActive theme name of the store.

CurrencyDetails (store.currency_details):

PropertyTypeAlways presentDescription
codestringYesCurrency code (e.g. "USD", "EUR", "BRL").
cents_separatorstringYesCharacter used to separate the decimal part (e.g. ",").
thousands_separatorstringYesCharacter used to separate thousands (e.g. ".").
display_longstringYesLong form of the currency symbol (e.g. "R$").
display_shortstringYesShort form of the currency symbol (e.g. "R$").

Example

import type { NubeSDK } from "@tiendanube/nube-sdk-types";

export function App(nube: NubeSDK) {
nube.on("cart:update", ({ store }) => {
const { currency_details } = store;

console.log(`code: ${currency_details.code}`);
console.log(`display_short: ${currency_details.display_short}`);
console.log(`display_long: ${currency_details.display_long}`);
console.log(`thousands_separator: ${currency_details.thousands_separator}`);
console.log(`cents_separator: ${currency_details.cents_separator}`);
});
}

For the exact TypeScript definitions, use Store and CurrencyDetails from @tiendanube/nube-sdk-types.

device: Device

Information about the device being used to access the application, including screen dimensions and device type.

PropertyTypeAlways presentDescription
screenDeviceScreenYesScreen dimensions, orientation, pixel ratio.
type"mobile" or "desktop"YesThe type of device.

DeviceScreen (device.screen):

PropertyTypeAlways presentDescription
widthnumberYesWidth of the screen in pixels.
heightnumberYesHeight of the screen in pixels.
orientation"portrait" or "landscape"YesOrientation of the screen.
pixelRationumberYesPixel ratio of the screen.
innerWidthnumberYesWidth of the inner window in pixels.
innerHeightnumberYesHeight of the inner window in pixels.

For the exact TypeScript definitions, use the types from @tiendanube/nube-sdk-types (e.g. Device, DeviceScreen).

config: AppConfig

Application-wide configuration settings, including cart validation rules.

PropertyTypeAlways presentDescription
has_cart_validationbooleanYesDetermines whether cart validation is enabled.
disable_shipping_more_optionsbooleanYesDetermines whether the user can select a shipping option.

For the exact TypeScript definition, use AppConfig from @tiendanube/nube-sdk-types.

Help us improve NubeSDK

Found an issue or have a suggestion? Let us know on GitHub.