Skip to content
Mehrdad Pajuhaan edited this page Oct 23, 2026 · 1 revision

FAQ

Answers to common questions about Selldone Core, including the errors you may see at start-up and how to fix them. If your question is not here, search the issues or open a new one. Security problems go to security@selldone.com, never to public issues.

The service url is not defined in [service-url] meta tag!

SelldoneCore.Setup() needs the platform meta tags in <head>. Add at least service-url, selldone-gapi, selldone-iframe, selldone-cdn-images, selldone-cdn-jsons and selldone-cdn-ar (see Getting Started). Similar messages, such as The images CDN is not defined in [selldone-cdn-images] meta tag!, name the missing tag. If you cannot edit <head>, set the same keys on window.selldone_config before calling Setup().

The console warns CSRF token not found!

Harmless for most apps. It means there is no <meta name="csrf-token">, so no X-CSRF-TOKEN header is added. Add the tag only if the server that renders your page issues a CSRF token.

My bundler fails to import @selldone/core-js (TypeScript syntax or .svg imports).

The package entry point is index.ts, and some enums import images. Use a bundler that compiles TypeScript from node_modules and handles asset imports, such as Vite (the official Storefront uses Vite). For TypeScript, types/assets.d.ts declares *.svg, *.png, *.jpg, *.gif and *.mp3 modules.

Why can't I import Currency (or StorefrontRoutesName, TimeSeries) from the package root?

The root re-exports helper/, models/, server/, utils/ and prototypes/ only. Import enums, gapi/, timeserie/ and types/ by file path, for example import { Currency } from "@selldone/core-js/enums/payment/Currency". Default exports such as GlobalRules, ScrollHelper and the cookie helper are also imported by path.

Do I need to call SelldoneCore.Setup() when I use an SDK?

  • Storefront SDK: optional. StorefrontSDK.Setup() calls it if Core is not initialized.
  • Backoffice SDK: yes. Call SelldoneCore.Setup() first, otherwise it throws ❌ console.style not found. Please initialize 'SelldoneCore.Setup()' before initializing the Backoffice SDK.

Labels show keys such as global.currency.USD instead of text.

Enum name / title values are i18n keys. Translate them with your i18n library, for example i18n.global.t(Currency.USD.name). Translation files are in selldone/translate.

Cannot read properties of undefined (reading 't') from a validation rule or address helper.

GlobalRules, MapHelper and a few other helpers translate messages with window.$i18n_global. Pass your i18n instance once: SelldoneCore.Setup({ i18n: i18n.global }). Date helpers such as DateConverter.SecondsToString() use window.$t, and relative dates use window.$language when no locale is passed.

optimize() does not seem to cache anything.

Responses are stored only for requests chained with .cache(callback) before .then(). Use api.optimize(600).fetchSomething().cache(render).then(render). The store lives in memory and is cleared on reload; CleanCache() clears it manually. See Server and APIs.

Importing Core changed Array.prototype. Is that expected?

Yes. Importing the package root installs the extensions in prototypes/ (for example limit, sumByKey, uniqueByKey) and the Date helpers in helper/date/DateConverter.ts (addDays, setStart…). Selldone packages rely on them. See Helpers and Utilities → Prototypes.

Can I use Selldone Core in Node.js?

Selldone Core targets the browser: Setup(), SetupService, CDN, cookies and local-storage helpers use document, window and localStorage. Pure types and many enums can be imported anywhere TypeScript runs, but initialize and call runtime helpers in the browser.

How do I contribute a new model or enum?

Follow the existing patterns: a class or interface plus a namespace with the same name, fields documented with their backend source, and catalog entries with a code and i18n keys. Keep changes backward compatible, because every Selldone package depends on Core. Read the contributing guide.

Next steps

Clone this wiki locally