@cimplify/cli 0.5.1 → 0.5.2

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 (52) hide show
  1. package/dist/{add-IJELMSCY.mjs → add-BEJH4T3P.mjs} +1 -1
  2. package/dist/{chunk-U3DWSQYY.mjs → chunk-DZPR5L6H.mjs} +1 -1
  3. package/dist/{chunk-O7SMBTHQ.mjs → chunk-MUG454RK.mjs} +1 -1
  4. package/dist/{chunk-DENWIVVB.mjs → chunk-TR65XHUE.mjs} +12 -12
  5. package/dist/dispatcher.mjs +9 -9
  6. package/dist/{doctor-NUKNW4S3.mjs → doctor-QO2SRNH6.mjs} +2 -2
  7. package/dist/{explain-TGRXJW3V.mjs → explain-CGWT7HMV.mjs} +1 -1
  8. package/dist/{introspect-5W72YWFT.mjs → introspect-WDGC7BKQ.mjs} +2 -2
  9. package/dist/{list-VO4LKRDN.mjs → list-NO5SPHSU.mjs} +1 -1
  10. package/dist/{update-V7XIKMFU.mjs → update-EEQ7JJTP.mjs} +1 -1
  11. package/package.json +1 -1
  12. package/templates/manifest.json +2 -2
  13. package/templates/storefront-auto/.env.example +12 -8
  14. package/templates/storefront-auto/README.md +1 -3
  15. package/templates/storefront-auto/app/.well-known/ucp/route.ts +4 -8
  16. package/templates/storefront-auto/components/providers.tsx +3 -12
  17. package/templates/storefront-auto/next.config.ts +10 -16
  18. package/templates/storefront-bakery/.env.example +2 -7
  19. package/templates/storefront-bakery/README.md +1 -3
  20. package/templates/storefront-bakery/app/.well-known/ucp/route.ts +4 -8
  21. package/templates/storefront-bakery/components/providers.tsx +3 -12
  22. package/templates/storefront-bakery/next.config.ts +10 -16
  23. package/templates/storefront-fashion/.env.example +12 -8
  24. package/templates/storefront-fashion/README.md +2 -4
  25. package/templates/storefront-fashion/app/.well-known/ucp/route.ts +4 -8
  26. package/templates/storefront-fashion/components/providers.tsx +3 -12
  27. package/templates/storefront-fashion/next.config.ts +10 -16
  28. package/templates/storefront-grocery/.env.example +12 -8
  29. package/templates/storefront-grocery/README.md +2 -4
  30. package/templates/storefront-grocery/app/.well-known/ucp/route.ts +4 -8
  31. package/templates/storefront-grocery/components/providers.tsx +3 -12
  32. package/templates/storefront-grocery/next.config.ts +10 -16
  33. package/templates/storefront-pharmacy/.env.example +12 -8
  34. package/templates/storefront-pharmacy/README.md +1 -3
  35. package/templates/storefront-pharmacy/app/.well-known/ucp/route.ts +4 -8
  36. package/templates/storefront-pharmacy/components/providers.tsx +3 -12
  37. package/templates/storefront-pharmacy/next.config.ts +10 -16
  38. package/templates/storefront-restaurant/.env.example +12 -8
  39. package/templates/storefront-restaurant/README.md +2 -4
  40. package/templates/storefront-restaurant/app/.well-known/ucp/route.ts +4 -8
  41. package/templates/storefront-restaurant/components/providers.tsx +3 -12
  42. package/templates/storefront-restaurant/next.config.ts +10 -16
  43. package/templates/storefront-retail/.env.example +12 -8
  44. package/templates/storefront-retail/README.md +1 -3
  45. package/templates/storefront-retail/app/.well-known/ucp/route.ts +4 -8
  46. package/templates/storefront-retail/components/providers.tsx +3 -12
  47. package/templates/storefront-retail/next.config.ts +10 -16
  48. package/templates/storefront-services/.env.example +12 -8
  49. package/templates/storefront-services/README.md +2 -4
  50. package/templates/storefront-services/app/.well-known/ucp/route.ts +4 -8
  51. package/templates/storefront-services/components/providers.tsx +3 -12
  52. package/templates/storefront-services/next.config.ts +10 -16
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { TEMPLATES } from './chunk-DENWIVVB.mjs';
3
- import { package_default } from './chunk-U3DWSQYY.mjs';
2
+ import { TEMPLATES } from './chunk-TR65XHUE.mjs';
3
+ import { package_default } from './chunk-DZPR5L6H.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -134,15 +134,15 @@ var COMMANDS = {
134
134
  logs: () => import('./logs-YNN2PQ24.mjs'),
135
135
  status: () => import('./status-JSYXM5RT.mjs'),
136
136
  dev: () => import('./dev-ONW2S77K.mjs'),
137
- introspect: () => import('./introspect-5W72YWFT.mjs'),
138
- doctor: () => import('./doctor-NUKNW4S3.mjs'),
139
- explain: () => import('./explain-TGRXJW3V.mjs'),
137
+ introspect: () => import('./introspect-WDGC7BKQ.mjs'),
138
+ doctor: () => import('./doctor-QO2SRNH6.mjs'),
139
+ explain: () => import('./explain-CGWT7HMV.mjs'),
140
140
  assets: () => import('./assets-EBEMMENZ.mjs'),
141
141
  repo: () => import('./repo-WOBWKEAO.mjs'),
142
- list: () => import('./list-VO4LKRDN.mjs'),
143
- add: () => import('./add-IJELMSCY.mjs'),
144
- update: () => import('./update-V7XIKMFU.mjs'),
145
- upgrade: () => import('./update-V7XIKMFU.mjs'),
142
+ list: () => import('./list-NO5SPHSU.mjs'),
143
+ add: () => import('./add-BEJH4T3P.mjs'),
144
+ update: () => import('./update-EEQ7JJTP.mjs'),
145
+ upgrade: () => import('./update-EEQ7JJTP.mjs'),
146
146
  "auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
147
147
  };
148
148
  var COMMAND_PREFIXES = {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { gatherIntrospection } from './chunk-O7SMBTHQ.mjs';
2
+ import { gatherIntrospection } from './chunk-MUG454RK.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-U3DWSQYY.mjs';
5
+ import './chunk-DZPR5L6H.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-U3DWSQYY.mjs';
2
+ import { package_default } from './chunk-DZPR5L6H.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-O7SMBTHQ.mjs';
2
+ export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-MUG454RK.mjs';
3
3
  import './chunk-K5464A3L.mjs';
4
4
  import './chunk-DBZ3UOQ2.mjs';
5
- import './chunk-U3DWSQYY.mjs';
5
+ import './chunk-DZPR5L6H.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-DENWIVVB.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-TR65XHUE.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-U3DWSQYY.mjs';
2
+ import { package_default } from './chunk-DZPR5L6H.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.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -1,6 +1,6 @@
1
1
  {
2
- "cliVersion": "0.5.1",
3
- "generatedAt": "2026-05-16T19:25:00.000Z",
2
+ "cliVersion": "0.5.2",
3
+ "generatedAt": "2026-05-16T20:10:00.000Z",
4
4
  "templates": [
5
5
  {
6
6
  "id": "bakery",
@@ -1,13 +1,8 @@
1
- # Cimplify API base URL.
2
- # Dev: leave empty so the SDK uses the current origin (localhost:3000),
3
- # which Next.js rewrites to the mock at 127.0.0.1:8787 (see next.config.ts).
4
- # Production: set to your Cimplify host (e.g. https://api.cimplify.io).
5
- NEXT_PUBLIC_CIMPLIFY_API_URL=
6
-
7
- # Tenant public key. The mock accepts any value.
1
+ # Tenant public key. Get yours from the desk Developers tab. The mock
2
+ # accepts any value, so leave the placeholder during local dev.
8
3
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
9
4
 
10
- # Business id used by the mock seed (auto: Driveline Auto Parts).
5
+ # Business id used by the mock seed (default: Driveline Auto).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_driveline_auto
12
7
 
13
8
  # Canonical public site URL — used by sitemap.xml, robots.txt, llms.txt,
@@ -20,3 +15,12 @@ NEXT_PUBLIC_SITE_URL=https://example.com
20
15
  # Gemini) can discover this storefront's commerce capabilities. Set this
21
16
  # on production deploys; leave empty in dev unless you're testing UCP.
22
17
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
18
+
19
+ # ── Escape hatches (rarely needed) ────────────────────────────────────
20
+ # Override the storefront API host (where /api/v1/catalogue, /api/v1/orders
21
+ # live). Defaults to https://storefronts.cimplify.io in production,
22
+ # 127.0.0.1:8787 in dev. Set only for self-hosted Cimplify or staging.
23
+ # NEXT_PUBLIC_CIMPLIFY_STOREFRONT_URL=
24
+
25
+ # Override the management/UCP host. Defaults to https://api.cimplify.io.
26
+ # NEXT_PUBLIC_CIMPLIFY_API_URL=
@@ -37,12 +37,10 @@ Update `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID` in `.env.local` to match the seeded bu
37
37
 
38
38
  ```diff
39
39
  # .env.local
40
- - NEXT_PUBLIC_CIMPLIFY_API_URL=http://127.0.0.1:8787
41
- + NEXT_PUBLIC_CIMPLIFY_API_URL=https://api.cimplify.io
42
40
  - NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
43
41
  + NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=<your tenant key>
44
42
  - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_driveline_auto
45
43
  + NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=<your business id>
46
44
  ```
47
45
 
48
- Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://docs.cimplify.io/cli/deploy). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
46
+ Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://www.cimplify.dev/docs/cli). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
@@ -5,15 +5,11 @@ import { NextResponse } from "next/server";
5
5
  *
6
6
  * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
7
  * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
- * capabilities your storefront supports. We forward the request to
9
- * Cimplify, which returns the canonical manifest; the response body
10
- * tells agents to make subsequent UCP calls directly to
11
- * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
- *
13
- * Edge-cached for an hour because capabilities change rarely.
8
+ * capabilities your storefront supports. We forward to Cimplify, which
9
+ * returns the canonical manifest. Edge-cached for an hour because
10
+ * capabilities change rarely.
14
11
  */
15
- const UCP_API_BASE =
16
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
12
+ const UCP_API_BASE = "https://api.cimplify.io";
17
13
 
18
14
 
19
15
  export async function GET() {
@@ -4,21 +4,12 @@ import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
6
 
7
- /**
8
- * Boots the Cimplify SDK client once on the client-side and exposes it via
9
- * <CimplifyProvider/>.
10
- *
11
- * Base-URL resolution:
12
- * 1) If NEXT_PUBLIC_CIMPLIFY_API_URL is set, use it verbatim.
13
- * 2) Otherwise use the current origin so requests flow through the
14
- * Next.js rewrite in `next.config.ts` to the mock at :8787 (no CORS).
15
- * 3) Fall back to 127.0.0.1:8787 only during SSR, when there's no window.
16
- */
7
+ // Same-origin client — every request goes through the Next.js rewrite in
8
+ // next.config.ts, so no CORS preflight ever hits the browser.
17
9
  export function Providers({ children }: { children: ReactNode }) {
18
10
  const client = useMemo(() => {
19
11
  const baseUrl =
20
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() ||
21
- (typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787");
12
+ typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787";
22
13
  const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY ?? "mock-dev";
23
14
  return createCimplifyClient({
24
15
  baseUrl,
@@ -1,18 +1,12 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- const MOCK_URL = process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() || "http://127.0.0.1:8787";
3
+ // Same-origin proxy target for the storefront API. Local mock in dev,
4
+ // hosted Cimplify in prod.
5
+ const STOREFRONT_URL =
6
+ process.env.NODE_ENV === "production"
7
+ ? "https://storefronts.cimplify.io"
8
+ : "http://127.0.0.1:8787";
4
9
 
5
- /**
6
- * Same-origin proxy to the Cimplify mock so the browser never makes a
7
- * cross-origin request in dev (no CORS preflights, no flaky `Origin`
8
- * mismatches). The SDK's base URL stays empty/relative — requests go to
9
- * `/api/v1/...` on the Next origin, then this rewrite forwards them to
10
- * the mock at `127.0.0.1:8787`.
11
- *
12
- * In production, point `NEXT_PUBLIC_CIMPLIFY_API_URL` at your Cimplify
13
- * host and the rewrite continues to work the same way (or remove it and
14
- * pass the absolute URL through `<CimplifyProvider/>`).
15
- */
16
10
  const nextConfig: NextConfig = {
17
11
  // Enable Next 16's `cacheComponents` mode so we can use `'use cache'` +
18
12
  // `cacheTag` / `cacheLife` for SSR caching. Cached chrome streams first,
@@ -20,10 +14,10 @@ const nextConfig: NextConfig = {
20
14
  cacheComponents: true,
21
15
  async rewrites() {
22
16
  return [
23
- { source: "/api/v1/:path*", destination: `${MOCK_URL}/api/v1/:path*` },
24
- { source: "/img/:path*", destination: `${MOCK_URL}/img/:path*` },
25
- { source: "/elements/:path*", destination: `${MOCK_URL}/elements/:path*` },
26
- { source: "/_mock/:path*", destination: `${MOCK_URL}/_mock/:path*` },
17
+ { source: "/api/v1/:path*", destination: `${STOREFRONT_URL}/api/v1/:path*` },
18
+ { source: "/img/:path*", destination: `${STOREFRONT_URL}/img/:path*` },
19
+ { source: "/elements/:path*", destination: `${STOREFRONT_URL}/elements/:path*` },
20
+ { source: "/_mock/:path*", destination: `${STOREFRONT_URL}/_mock/:path*` },
27
21
  ];
28
22
  },
29
23
  images: {
@@ -1,10 +1,5 @@
1
- # Cimplify API base URL.
2
- # Dev: leave empty so the SDK uses the current origin (localhost:3000),
3
- # which Next.js rewrites to the mock at 127.0.0.1:8787 (see next.config.ts).
4
- # Production: set to your Cimplify host (e.g. https://api.cimplify.io).
5
- NEXT_PUBLIC_CIMPLIFY_API_URL=
6
-
7
- # Tenant public key. The mock accepts any value.
1
+ # Tenant public key. Get yours from the desk Developers tab. The mock
2
+ # accepts any value, so leave the placeholder during local dev.
8
3
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
9
4
 
10
5
  # Business id used by the mock seed (default: Akua's Bakery).
@@ -62,12 +62,10 @@ Update `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID` in `.env.local` to match the seeded bu
62
62
 
63
63
  ```diff
64
64
  # .env.local
65
- - NEXT_PUBLIC_CIMPLIFY_API_URL=http://127.0.0.1:8787
66
- + NEXT_PUBLIC_CIMPLIFY_API_URL=https://api.cimplify.io
67
65
  - NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
68
66
  + NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=<your tenant key>
69
67
  - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_default_akua_bakery
70
68
  + NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=<your business id>
71
69
  ```
72
70
 
73
- Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://docs.cimplify.io/cli/deploy). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
71
+ Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://www.cimplify.dev/docs/cli). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
@@ -5,15 +5,11 @@ import { NextResponse } from "next/server";
5
5
  *
6
6
  * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
7
  * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
- * capabilities your storefront supports. We forward the request to
9
- * Cimplify, which returns the canonical manifest; the response body
10
- * tells agents to make subsequent UCP calls directly to
11
- * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
- *
13
- * Edge-cached for an hour because capabilities change rarely.
8
+ * capabilities your storefront supports. We forward to Cimplify, which
9
+ * returns the canonical manifest. Edge-cached for an hour because
10
+ * capabilities change rarely.
14
11
  */
15
- const UCP_API_BASE =
16
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
12
+ const UCP_API_BASE = "https://api.cimplify.io";
17
13
 
18
14
 
19
15
  export async function GET() {
@@ -4,21 +4,12 @@ import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
6
 
7
- /**
8
- * Boots the Cimplify SDK client once on the client-side and exposes it via
9
- * <CimplifyProvider/>.
10
- *
11
- * Base-URL resolution:
12
- * 1) If NEXT_PUBLIC_CIMPLIFY_API_URL is set, use it verbatim.
13
- * 2) Otherwise use the current origin so requests flow through the
14
- * Next.js rewrite in `next.config.ts` to the mock at :8787 (no CORS).
15
- * 3) Fall back to 127.0.0.1:8787 only during SSR, when there's no window.
16
- */
7
+ // Same-origin client — every request goes through the Next.js rewrite in
8
+ // next.config.ts, so no CORS preflight ever hits the browser.
17
9
  export function Providers({ children }: { children: ReactNode }) {
18
10
  const client = useMemo(() => {
19
11
  const baseUrl =
20
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() ||
21
- (typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787");
12
+ typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787";
22
13
  const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY ?? "mock-dev";
23
14
  return createCimplifyClient({
24
15
  baseUrl,
@@ -1,18 +1,12 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- const MOCK_URL = process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() || "http://127.0.0.1:8787";
3
+ // Same-origin proxy target for the storefront API. Local mock in dev,
4
+ // hosted Cimplify in prod.
5
+ const STOREFRONT_URL =
6
+ process.env.NODE_ENV === "production"
7
+ ? "https://storefronts.cimplify.io"
8
+ : "http://127.0.0.1:8787";
4
9
 
5
- /**
6
- * Same-origin proxy to the Cimplify mock so the browser never makes a
7
- * cross-origin request in dev (no CORS preflights, no flaky `Origin`
8
- * mismatches). The SDK's base URL stays empty/relative — requests go to
9
- * `/api/v1/...` on the Next origin, then this rewrite forwards them to
10
- * the mock at `127.0.0.1:8787`.
11
- *
12
- * In production, point `NEXT_PUBLIC_CIMPLIFY_API_URL` at your Cimplify
13
- * host and the rewrite continues to work the same way (or remove it and
14
- * pass the absolute URL through `<CimplifyProvider/>`).
15
- */
16
10
  const nextConfig: NextConfig = {
17
11
  // Enable Next 16's `cacheComponents` mode so we can use `'use cache'` +
18
12
  // `cacheTag` / `cacheLife` for SSR caching. Cached chrome streams first,
@@ -20,10 +14,10 @@ const nextConfig: NextConfig = {
20
14
  cacheComponents: true,
21
15
  async rewrites() {
22
16
  return [
23
- { source: "/api/v1/:path*", destination: `${MOCK_URL}/api/v1/:path*` },
24
- { source: "/img/:path*", destination: `${MOCK_URL}/img/:path*` },
25
- { source: "/elements/:path*", destination: `${MOCK_URL}/elements/:path*` },
26
- { source: "/_mock/:path*", destination: `${MOCK_URL}/_mock/:path*` },
17
+ { source: "/api/v1/:path*", destination: `${STOREFRONT_URL}/api/v1/:path*` },
18
+ { source: "/img/:path*", destination: `${STOREFRONT_URL}/img/:path*` },
19
+ { source: "/elements/:path*", destination: `${STOREFRONT_URL}/elements/:path*` },
20
+ { source: "/_mock/:path*", destination: `${STOREFRONT_URL}/_mock/:path*` },
27
21
  ];
28
22
  },
29
23
  images: {
@@ -1,13 +1,8 @@
1
- # Cimplify API base URL.
2
- # Dev: leave empty so the SDK uses the current origin (localhost:3000),
3
- # which Next.js rewrites to the mock at 127.0.0.1:8787 (see next.config.ts).
4
- # Production: set to your Cimplify host (e.g. https://api.cimplify.io).
5
- NEXT_PUBLIC_CIMPLIFY_API_URL=
6
-
7
- # Tenant public key. The mock accepts any value.
1
+ # Tenant public key. Get yours from the desk Developers tab. The mock
2
+ # accepts any value, so leave the placeholder during local dev.
8
3
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
9
4
 
10
- # Business id used by the mock seed (fashion: Studio FRX).
5
+ # Business id used by the mock seed (default: Studio FRX).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_studio_frx
12
7
 
13
8
  # Canonical public site URL — used by sitemap.xml, robots.txt, llms.txt,
@@ -20,3 +15,12 @@ NEXT_PUBLIC_SITE_URL=https://example.com
20
15
  # Gemini) can discover this storefront's commerce capabilities. Set this
21
16
  # on production deploys; leave empty in dev unless you're testing UCP.
22
17
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
18
+
19
+ # ── Escape hatches (rarely needed) ────────────────────────────────────
20
+ # Override the storefront API host (where /api/v1/catalogue, /api/v1/orders
21
+ # live). Defaults to https://storefronts.cimplify.io in production,
22
+ # 127.0.0.1:8787 in dev. Set only for self-hosted Cimplify or staging.
23
+ # NEXT_PUBLIC_CIMPLIFY_STOREFRONT_URL=
24
+
25
+ # Override the management/UCP host. Defaults to https://api.cimplify.io.
26
+ # NEXT_PUBLIC_CIMPLIFY_API_URL=
@@ -66,12 +66,10 @@ cimplify init my-store --template grocery # coming soon
66
66
 
67
67
  ```diff
68
68
  # .env.local
69
- - NEXT_PUBLIC_CIMPLIFY_API_URL=http://127.0.0.1:8787
70
- + NEXT_PUBLIC_CIMPLIFY_API_URL=https://api.cimplify.io
71
69
  - NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
72
70
  + NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=<your tenant key>
73
- - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_currents_electronics
71
+ - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_studio_frx
74
72
  + NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=<your business id>
75
73
  ```
76
74
 
77
- Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://docs.cimplify.io/cli/deploy). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
75
+ Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://www.cimplify.dev/docs/cli). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
@@ -5,15 +5,11 @@ import { NextResponse } from "next/server";
5
5
  *
6
6
  * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
7
  * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
- * capabilities your storefront supports. We forward the request to
9
- * Cimplify, which returns the canonical manifest; the response body
10
- * tells agents to make subsequent UCP calls directly to
11
- * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
- *
13
- * Edge-cached for an hour because capabilities change rarely.
8
+ * capabilities your storefront supports. We forward to Cimplify, which
9
+ * returns the canonical manifest. Edge-cached for an hour because
10
+ * capabilities change rarely.
14
11
  */
15
- const UCP_API_BASE =
16
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
12
+ const UCP_API_BASE = "https://api.cimplify.io";
17
13
 
18
14
 
19
15
  export async function GET() {
@@ -4,21 +4,12 @@ import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
6
 
7
- /**
8
- * Boots the Cimplify SDK client once on the client-side and exposes it via
9
- * <CimplifyProvider/>.
10
- *
11
- * Base-URL resolution:
12
- * 1) If NEXT_PUBLIC_CIMPLIFY_API_URL is set, use it verbatim.
13
- * 2) Otherwise use the current origin so requests flow through the
14
- * Next.js rewrite in `next.config.ts` to the mock at :8787 (no CORS).
15
- * 3) Fall back to 127.0.0.1:8787 only during SSR, when there's no window.
16
- */
7
+ // Same-origin client — every request goes through the Next.js rewrite in
8
+ // next.config.ts, so no CORS preflight ever hits the browser.
17
9
  export function Providers({ children }: { children: ReactNode }) {
18
10
  const client = useMemo(() => {
19
11
  const baseUrl =
20
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() ||
21
- (typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787");
12
+ typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787";
22
13
  const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY ?? "mock-dev";
23
14
  return createCimplifyClient({
24
15
  baseUrl,
@@ -1,18 +1,12 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- const MOCK_URL = process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() || "http://127.0.0.1:8787";
3
+ // Same-origin proxy target for the storefront API. Local mock in dev,
4
+ // hosted Cimplify in prod.
5
+ const STOREFRONT_URL =
6
+ process.env.NODE_ENV === "production"
7
+ ? "https://storefronts.cimplify.io"
8
+ : "http://127.0.0.1:8787";
4
9
 
5
- /**
6
- * Same-origin proxy to the Cimplify mock so the browser never makes a
7
- * cross-origin request in dev (no CORS preflights, no flaky `Origin`
8
- * mismatches). The SDK's base URL stays empty/relative — requests go to
9
- * `/api/v1/...` on the Next origin, then this rewrite forwards them to
10
- * the mock at `127.0.0.1:8787`.
11
- *
12
- * In production, point `NEXT_PUBLIC_CIMPLIFY_API_URL` at your Cimplify
13
- * host and the rewrite continues to work the same way (or remove it and
14
- * pass the absolute URL through `<CimplifyProvider/>`).
15
- */
16
10
  const nextConfig: NextConfig = {
17
11
  // Enable Next 16's `cacheComponents` mode so we can use `'use cache'` +
18
12
  // `cacheTag` / `cacheLife` for SSR caching. Cached chrome streams first,
@@ -20,10 +14,10 @@ const nextConfig: NextConfig = {
20
14
  cacheComponents: true,
21
15
  async rewrites() {
22
16
  return [
23
- { source: "/api/v1/:path*", destination: `${MOCK_URL}/api/v1/:path*` },
24
- { source: "/img/:path*", destination: `${MOCK_URL}/img/:path*` },
25
- { source: "/elements/:path*", destination: `${MOCK_URL}/elements/:path*` },
26
- { source: "/_mock/:path*", destination: `${MOCK_URL}/_mock/:path*` },
17
+ { source: "/api/v1/:path*", destination: `${STOREFRONT_URL}/api/v1/:path*` },
18
+ { source: "/img/:path*", destination: `${STOREFRONT_URL}/img/:path*` },
19
+ { source: "/elements/:path*", destination: `${STOREFRONT_URL}/elements/:path*` },
20
+ { source: "/_mock/:path*", destination: `${STOREFRONT_URL}/_mock/:path*` },
27
21
  ];
28
22
  },
29
23
  images: {
@@ -1,13 +1,8 @@
1
- # Cimplify API base URL.
2
- # Dev: leave empty so the SDK uses the current origin (localhost:3000),
3
- # which Next.js rewrites to the mock at 127.0.0.1:8787 (see next.config.ts).
4
- # Production: set to your Cimplify host (e.g. https://api.cimplify.io).
5
- NEXT_PUBLIC_CIMPLIFY_API_URL=
6
-
7
- # Tenant public key. The mock accepts any value.
1
+ # Tenant public key. Get yours from the desk Developers tab. The mock
2
+ # accepts any value, so leave the placeholder during local dev.
8
3
  NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
9
4
 
10
- # Business id used by the mock seed (grocery: FreshMart).
5
+ # Business id used by the mock seed (default: FreshMart).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_freshmart
12
7
 
13
8
  # Canonical public site URL — used by sitemap.xml, robots.txt, llms.txt,
@@ -20,3 +15,12 @@ NEXT_PUBLIC_SITE_URL=https://example.com
20
15
  # Gemini) can discover this storefront's commerce capabilities. Set this
21
16
  # on production deploys; leave empty in dev unless you're testing UCP.
22
17
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
18
+
19
+ # ── Escape hatches (rarely needed) ────────────────────────────────────
20
+ # Override the storefront API host (where /api/v1/catalogue, /api/v1/orders
21
+ # live). Defaults to https://storefronts.cimplify.io in production,
22
+ # 127.0.0.1:8787 in dev. Set only for self-hosted Cimplify or staging.
23
+ # NEXT_PUBLIC_CIMPLIFY_STOREFRONT_URL=
24
+
25
+ # Override the management/UCP host. Defaults to https://api.cimplify.io.
26
+ # NEXT_PUBLIC_CIMPLIFY_API_URL=
@@ -62,12 +62,10 @@ Update `NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID` in `.env.local` to match the seeded bu
62
62
 
63
63
  ```diff
64
64
  # .env.local
65
- - NEXT_PUBLIC_CIMPLIFY_API_URL=http://127.0.0.1:8787
66
- + NEXT_PUBLIC_CIMPLIFY_API_URL=https://api.cimplify.io
67
65
  - NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
68
66
  + NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=<your tenant key>
69
- - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_default_akua_bakery
67
+ - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_freshmart
70
68
  + NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=<your business id>
71
69
  ```
72
70
 
73
- Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://docs.cimplify.io/cli/deploy). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
71
+ Deploy with `cimplify deploy --prod` after linking the project. See [`cimplify` CLI docs](https://www.cimplify.dev/docs/cli). `next.config.ts` already whitelists the SDK image hosts under `images.remotePatterns`.
@@ -5,15 +5,11 @@ import { NextResponse } from "next/server";
5
5
  *
6
6
  * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
7
  * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
- * capabilities your storefront supports. We forward the request to
9
- * Cimplify, which returns the canonical manifest; the response body
10
- * tells agents to make subsequent UCP calls directly to
11
- * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
- *
13
- * Edge-cached for an hour because capabilities change rarely.
8
+ * capabilities your storefront supports. We forward to Cimplify, which
9
+ * returns the canonical manifest. Edge-cached for an hour because
10
+ * capabilities change rarely.
14
11
  */
15
- const UCP_API_BASE =
16
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
12
+ const UCP_API_BASE = "https://api.cimplify.io";
17
13
 
18
14
 
19
15
  export async function GET() {
@@ -4,21 +4,12 @@ import { useMemo, type ReactNode } from "react";
4
4
  import { createCimplifyClient } from "@cimplify/sdk";
5
5
  import { CimplifyProvider, CartDrawerProvider } from "@cimplify/sdk/react";
6
6
 
7
- /**
8
- * Boots the Cimplify SDK client once on the client-side and exposes it via
9
- * <CimplifyProvider/>.
10
- *
11
- * Base-URL resolution:
12
- * 1) If NEXT_PUBLIC_CIMPLIFY_API_URL is set, use it verbatim.
13
- * 2) Otherwise use the current origin so requests flow through the
14
- * Next.js rewrite in `next.config.ts` to the mock at :8787 (no CORS).
15
- * 3) Fall back to 127.0.0.1:8787 only during SSR, when there's no window.
16
- */
7
+ // Same-origin client — every request goes through the Next.js rewrite in
8
+ // next.config.ts, so no CORS preflight ever hits the browser.
17
9
  export function Providers({ children }: { children: ReactNode }) {
18
10
  const client = useMemo(() => {
19
11
  const baseUrl =
20
- process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() ||
21
- (typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787");
12
+ typeof window !== "undefined" ? window.location.origin : "http://127.0.0.1:8787";
22
13
  const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY ?? "mock-dev";
23
14
  return createCimplifyClient({
24
15
  baseUrl,
@@ -1,18 +1,12 @@
1
1
  import type { NextConfig } from "next";
2
2
 
3
- const MOCK_URL = process.env.NEXT_PUBLIC_CIMPLIFY_API_URL?.trim() || "http://127.0.0.1:8787";
3
+ // Same-origin proxy target for the storefront API. Local mock in dev,
4
+ // hosted Cimplify in prod.
5
+ const STOREFRONT_URL =
6
+ process.env.NODE_ENV === "production"
7
+ ? "https://storefronts.cimplify.io"
8
+ : "http://127.0.0.1:8787";
4
9
 
5
- /**
6
- * Same-origin proxy to the Cimplify mock so the browser never makes a
7
- * cross-origin request in dev (no CORS preflights, no flaky `Origin`
8
- * mismatches). The SDK's base URL stays empty/relative — requests go to
9
- * `/api/v1/...` on the Next origin, then this rewrite forwards them to
10
- * the mock at `127.0.0.1:8787`.
11
- *
12
- * In production, point `NEXT_PUBLIC_CIMPLIFY_API_URL` at your Cimplify
13
- * host and the rewrite continues to work the same way (or remove it and
14
- * pass the absolute URL through `<CimplifyProvider/>`).
15
- */
16
10
  const nextConfig: NextConfig = {
17
11
  // Enable Next 16's `cacheComponents` mode so we can use `'use cache'` +
18
12
  // `cacheTag` / `cacheLife` for SSR caching. Cached chrome streams first,
@@ -20,10 +14,10 @@ const nextConfig: NextConfig = {
20
14
  cacheComponents: true,
21
15
  async rewrites() {
22
16
  return [
23
- { source: "/api/v1/:path*", destination: `${MOCK_URL}/api/v1/:path*` },
24
- { source: "/img/:path*", destination: `${MOCK_URL}/img/:path*` },
25
- { source: "/elements/:path*", destination: `${MOCK_URL}/elements/:path*` },
26
- { source: "/_mock/:path*", destination: `${MOCK_URL}/_mock/:path*` },
17
+ { source: "/api/v1/:path*", destination: `${STOREFRONT_URL}/api/v1/:path*` },
18
+ { source: "/img/:path*", destination: `${STOREFRONT_URL}/img/:path*` },
19
+ { source: "/elements/:path*", destination: `${STOREFRONT_URL}/elements/:path*` },
20
+ { source: "/_mock/:path*", destination: `${STOREFRONT_URL}/_mock/:path*` },
27
21
  ];
28
22
  },
29
23
  images: {