Skip to main content

Setting Convenience Functions

EverShop provides convenience functions for common store settings. All are imported from @evershop/evershop/setting/services.

refreshSetting

Reload all settings from the database. Call this after programmatically updating settings to ensure the cache is fresh.

import { refreshSetting } from "@evershop/evershop/setting/services";

await refreshSetting();

Store Information Functions

These functions read from the setting database table (managed via the admin panel). Each returns Promise<string | null> (or Promise<string> with a default).

import {
getStoreName,
getStoreDescription,
getStoreEmail,
getStorePhoneNumber,
getStoreCountry,
getStoreProvince,
getStoreCity,
getStoreAddress,
getStorePostalCode,
} from "@evershop/evershop/setting/services";
FunctionDefaultReturns
getStoreName(default?)'Evershop'Store display name
getStoreDescription()nullStore description
getStoreEmail()nullStore contact email
getStorePhoneNumber()nullStore phone number
getStoreCountry()nullStore country (ISO code)
getStoreProvince()nullStore province/state
getStoreCity()nullStore city
getStoreAddress()nullStore street address
getStorePostalCode()nullStore postal/zip code

Examples

import {
getStoreName,
getStoreEmail,
} from "@evershop/evershop/setting/services";

const storeName = await getStoreName(); // 'My Shop'
const storeEmail = await getStoreEmail(); // 'contact@myshop.com'

See Also