brainerce 1.36.4 → 1.36.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,6 +100,8 @@ Violating any of these causes production incidents or broken orders. Read them b
|
|
|
100
100
|
- NEVER hardcode currency, locale, or language strings — read them from `getStoreInfo()`.
|
|
101
101
|
- NEVER format prices with `toFixed(2)` — use `formatPrice()` from the SDK.
|
|
102
102
|
- When i18n is enabled, call `client.setLocale(locale)` at app init and include a language switcher. For RTL locales (`he`, `ar`), set `<html dir="rtl">` — do NOT add `flex-row-reverse` on top.
|
|
103
|
+
- Call `setLocale()` **before `createCheckout()`** — the order captures the active locale (`order.locale`), which drives the confirmation-email language AND the product names shown in order history. Without it, orders and their emails fall back to the store default language. Search also needs the locale active to match translated names.
|
|
104
|
+
- Built-in order emails are localized for English and Hebrew; for other languages the merchant must add a custom email template per language (otherwise the email falls back to English).
|
|
103
105
|
|
|
104
106
|
### Type safety
|
|
105
107
|
|
package/dist/index.js
CHANGED
|
@@ -955,7 +955,7 @@ var BrainerceClient = class {
|
|
|
955
955
|
if (!this.storeId) {
|
|
956
956
|
throw new BrainerceError("storeId is required for storefront requests", 400);
|
|
957
957
|
}
|
|
958
|
-
const url = new URL(`${this.baseUrl}/stores/${encodePathSegment(this.storeId)}${path}`);
|
|
958
|
+
const url = new URL(`${this.baseUrl}/api/stores/${encodePathSegment(this.storeId)}${path}`);
|
|
959
959
|
if (queryParams) {
|
|
960
960
|
Object.entries(queryParams).forEach(([key, value]) => {
|
|
961
961
|
if (value !== void 0) {
|
package/dist/index.mjs
CHANGED
|
@@ -885,7 +885,7 @@ var BrainerceClient = class {
|
|
|
885
885
|
if (!this.storeId) {
|
|
886
886
|
throw new BrainerceError("storeId is required for storefront requests", 400);
|
|
887
887
|
}
|
|
888
|
-
const url = new URL(`${this.baseUrl}/stores/${encodePathSegment(this.storeId)}${path}`);
|
|
888
|
+
const url = new URL(`${this.baseUrl}/api/stores/${encodePathSegment(this.storeId)}${path}`);
|
|
889
889
|
if (queryParams) {
|
|
890
890
|
Object.entries(queryParams).forEach(([key, value]) => {
|
|
891
891
|
if (value !== void 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brainerce",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.5",
|
|
4
4
|
"description": "Official SDK for building e-commerce storefronts with Brainerce Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|