@cimplify/cli 0.6.4 → 0.6.8

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.
Files changed (35) hide show
  1. package/dist/{add-NWGER62A.mjs → add-U4S5DBPN.mjs} +1 -1
  2. package/dist/{chunk-MGP2FUAK.mjs → chunk-AS2SIMRN.mjs} +1 -1
  3. package/dist/{chunk-TFEUFCEH.mjs → chunk-EALN6SAN.mjs} +21 -21
  4. package/dist/{chunk-76TJ56KE.mjs → chunk-KPEMFKKN.mjs} +1 -1
  5. package/dist/dispatcher.mjs +9 -9
  6. package/dist/{doctor-ZGW3VZOG.mjs → doctor-Y6XJWZVX.mjs} +2 -2
  7. package/dist/{explain-4ITTI4FM.mjs → explain-WDIQSCUY.mjs} +1 -1
  8. package/dist/{introspect-DL2HE7DG.mjs → introspect-3EMAYETR.mjs} +2 -2
  9. package/dist/{list-WNNKVK7V.mjs → list-KO2QX42Q.mjs} +1 -1
  10. package/dist/{update-EPRLX6FL.mjs → update-J6ZDMCOB.mjs} +1 -1
  11. package/package.json +1 -1
  12. package/templates/storefront-auto/.env.example +4 -2
  13. package/templates/storefront-auto/next.config.ts +9 -3
  14. package/templates/storefront-auto/package.json +1 -1
  15. package/templates/storefront-bakery/.env.example +4 -2
  16. package/templates/storefront-bakery/next.config.ts +9 -3
  17. package/templates/storefront-bakery/package.json +1 -1
  18. package/templates/storefront-fashion/.env.example +4 -2
  19. package/templates/storefront-fashion/next.config.ts +9 -3
  20. package/templates/storefront-fashion/package.json +1 -1
  21. package/templates/storefront-grocery/.env.example +4 -2
  22. package/templates/storefront-grocery/next.config.ts +9 -3
  23. package/templates/storefront-grocery/package.json +1 -1
  24. package/templates/storefront-pharmacy/.env.example +4 -2
  25. package/templates/storefront-pharmacy/next.config.ts +9 -3
  26. package/templates/storefront-pharmacy/package.json +1 -1
  27. package/templates/storefront-restaurant/.env.example +4 -2
  28. package/templates/storefront-restaurant/next.config.ts +9 -3
  29. package/templates/storefront-restaurant/package.json +1 -1
  30. package/templates/storefront-retail/.env.example +4 -2
  31. package/templates/storefront-retail/next.config.ts +9 -3
  32. package/templates/storefront-retail/package.json +1 -1
  33. package/templates/storefront-services/.env.example +4 -2
  34. package/templates/storefront-services/next.config.ts +9 -3
  35. package/templates/storefront-services/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-K5464A3L.mjs';
3
3
  import { parseEnvFile } from './chunk-DBZ3UOQ2.mjs';
4
- import { package_default } from './chunk-MGP2FUAK.mjs';
4
+ import { package_default } from './chunk-AS2SIMRN.mjs';
5
5
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
6
6
  import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-UBAI443T.mjs';
7
7
  import { bold, dim, yellow, green, info, result, red } from './chunk-E2T2SBP5.mjs';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TEMPLATES } from './chunk-TFEUFCEH.mjs';
3
- import { package_default } from './chunk-MGP2FUAK.mjs';
2
+ import { TEMPLATES } from './chunk-EALN6SAN.mjs';
3
+ import { package_default } from './chunk-AS2SIMRN.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -137,15 +137,15 @@ var COMMANDS = {
137
137
  logs: () => import('./logs-YNN2PQ24.mjs'),
138
138
  status: () => import('./status-JSYXM5RT.mjs'),
139
139
  dev: () => import('./dev-ONW2S77K.mjs'),
140
- introspect: () => import('./introspect-DL2HE7DG.mjs'),
141
- doctor: () => import('./doctor-ZGW3VZOG.mjs'),
142
- explain: () => import('./explain-4ITTI4FM.mjs'),
140
+ introspect: () => import('./introspect-3EMAYETR.mjs'),
141
+ doctor: () => import('./doctor-Y6XJWZVX.mjs'),
142
+ explain: () => import('./explain-WDIQSCUY.mjs'),
143
143
  assets: () => import('./assets-EBEMMENZ.mjs'),
144
144
  repo: () => import('./repo-WOBWKEAO.mjs'),
145
- list: () => import('./list-WNNKVK7V.mjs'),
146
- add: () => import('./add-NWGER62A.mjs'),
147
- update: () => import('./update-EPRLX6FL.mjs'),
148
- upgrade: () => import('./update-EPRLX6FL.mjs'),
145
+ list: () => import('./list-KO2QX42Q.mjs'),
146
+ add: () => import('./add-U4S5DBPN.mjs'),
147
+ update: () => import('./update-J6ZDMCOB.mjs'),
148
+ upgrade: () => import('./update-J6ZDMCOB.mjs'),
149
149
  "auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
150
150
  };
151
151
  var COMMAND_PREFIXES = {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { gatherIntrospection } from './chunk-76TJ56KE.mjs';
2
+ import { gatherIntrospection } from './chunk-KPEMFKKN.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-MGP2FUAK.mjs';
5
+ import './chunk-AS2SIMRN.mjs';
6
6
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
7
7
  import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
8
8
  import { readAuthOrNull } from './chunk-UBAI443T.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-MGP2FUAK.mjs';
2
+ import { package_default } from './chunk-AS2SIMRN.mjs';
3
3
  import { parseArgs } from './chunk-C4M3DXKC.mjs';
4
4
  import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-76TJ56KE.mjs';
2
+ export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-KPEMFKKN.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-MGP2FUAK.mjs';
5
+ import './chunk-AS2SIMRN.mjs';
6
6
  import './chunk-C4M3DXKC.mjs';
7
7
  import './chunk-UBAI443T.mjs';
8
8
  import './chunk-E2T2SBP5.mjs';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX } from './chunk-TFEUFCEH.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-EALN6SAN.mjs';
3
3
  import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
4
4
  import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-MGP2FUAK.mjs';
2
+ import { package_default } from './chunk-AS2SIMRN.mjs';
3
3
  import { promptYesNo } from './chunk-ITAFAORS.mjs';
4
4
  import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
5
5
  import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/cli",
3
- "version": "0.6.4",
3
+ "version": "0.6.8",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -19,7 +19,7 @@
19
19
  "check": "bun run typecheck && bun run test:run"
20
20
  },
21
21
  "dependencies": {
22
- "@cimplify/sdk": "^0.48.0",
22
+ "@cimplify/sdk": "^0.48.2",
23
23
  "next": "^16.2.4",
24
24
  "react": "^19.0.0",
25
25
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -1,5 +1,7 @@
1
- # Your tenant public key. Get it from the desk's Developers tab in
2
- # production; the mock accepts any value during local dev.
1
+ # Your tenant public key. Get it from the desk's Developers tab.
2
+ # `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
3
+ # to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
4
+ # empty) falls back to the local `cimplify dev` mock.
3
5
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
4
6
 
5
7
  # Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
@@ -1,9 +1,15 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- // Same-origin proxy target for the storefront API. Local mock in dev,
4
- // hosted Cimplify in prod.
3
+ // Same-origin proxy target for the storefront API. The public key
4
+ // decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
5
+ // hosted Cimplify, so browser cart writes go to the same place the
6
+ // server catalogue reads come from. Anything else (`mock-dev`, empty)
7
+ // falls back to the local `cimplify dev` mock in dev.
8
+ const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
9
+ const keyTargetsHostedCimplify =
10
+ publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
5
11
  const STOREFRONT_URL =
6
- process.env.NODE_ENV === "production"
12
+ process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
7
13
  ? "https://storefronts.cimplify.io"
8
14
  : "http://127.0.0.1:8787";
9
15
 
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.48.0",
20
+ "@cimplify/sdk": "^0.48.2",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"