@decocms/apps 0.23.0 → 0.23.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/apps",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "type": "module",
5
5
  "description": "Deco commerce apps for TanStack Start - Shopify, VTEX, commerce types, analytics utils",
6
6
  "exports": {
package/vtex/client.ts CHANGED
@@ -483,13 +483,15 @@ export function initVtexFromBlocks(blocks: Record<string, any>) {
483
483
  console.warn("[VTEX] No vtex.json block found.");
484
484
  return;
485
485
  }
486
+ const appKey = typeof vtexBlock.appKey === "string" ? vtexBlock.appKey : undefined;
487
+ const appToken = typeof vtexBlock.appToken === "string" ? vtexBlock.appToken : undefined;
486
488
  configureVtex({
487
489
  account: vtexBlock.account,
488
490
  publicUrl: vtexBlock.publicUrl,
489
491
  salesChannel: vtexBlock.salesChannel || "1",
490
492
  locale: vtexBlock.locale || vtexBlock.defaultLocale,
491
- appKey: vtexBlock.appKey,
492
- appToken: vtexBlock.appToken,
493
+ appKey,
494
+ appToken,
493
495
  country: vtexBlock.country,
494
496
  domain: vtexBlock.domain,
495
497
  });
@@ -158,7 +158,7 @@ export async function proxyToVtex(
158
158
  }
159
159
  }
160
160
 
161
- if (config.appKey && config.appToken) {
161
+ if (typeof config.appKey === "string" && typeof config.appToken === "string") {
162
162
  forwardHeaders.set("X-VTEX-API-AppKey", config.appKey);
163
163
  forwardHeaders.set("X-VTEX-API-AppToken", config.appToken);
164
164
  }