@cimplify/cli 0.5.0 → 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-MX4655EX.mjs → add-BEJH4T3P.mjs} +1 -1
  2. package/dist/{chunk-DCWHOH2S.mjs → chunk-DZPR5L6H.mjs} +1 -1
  3. package/dist/{chunk-AY23RQE6.mjs → chunk-MUG454RK.mjs} +1 -1
  4. package/dist/{chunk-Z5DEA7YM.mjs → chunk-TR65XHUE.mjs} +12 -12
  5. package/dist/dispatcher.mjs +9 -9
  6. package/dist/{doctor-DGO3UAJB.mjs → doctor-QO2SRNH6.mjs} +2 -2
  7. package/dist/{explain-IJLIQUYJ.mjs → explain-CGWT7HMV.mjs} +1 -1
  8. package/dist/{introspect-KID4YJYV.mjs → introspect-WDGC7BKQ.mjs} +2 -2
  9. package/dist/{list-5PMRTZV3.mjs → list-NO5SPHSU.mjs} +1 -1
  10. package/dist/{update-64K4Z3SF.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 +11 -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 +11 -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 +11 -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 +11 -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 +11 -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 +11 -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 +11 -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 +11 -16
@@ -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: {
@@ -38,6 +32,7 @@ const nextConfig: NextConfig = {
38
32
  { protocol: "https", hostname: "static-tmp.cimplify.io", pathname: "/**" },
39
33
  { protocol: "https", hostname: "storefrontassetscdn.cimplify.io", pathname: "/**" },
40
34
  { protocol: "https", hostname: "cdn.cimplify.io", pathname: "/**" },
35
+ { protocol: "https", hostname: "res.cloudinary.com", pathname: "/cimplify/**" },
41
36
  ],
42
37
  },
43
38
  };
@@ -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 (pharmacy: Wellspring Pharmacy).
5
+ # Business id used by the mock seed (default: Wellspring Pharmacy).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_wellspring_pharmacy
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=
@@ -76,12 +76,10 @@ cimplify init my-store --template retail
76
76
 
77
77
  ```diff
78
78
  # .env.local
79
- - NEXT_PUBLIC_CIMPLIFY_API_URL=http://127.0.0.1:8787
80
- + NEXT_PUBLIC_CIMPLIFY_API_URL=https://api.cimplify.io
81
79
  - NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
82
80
  + NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=<your tenant key>
83
81
  - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_wellspring_pharmacy
84
82
  + NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=<your business id>
85
83
  ```
86
84
 
87
- 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`.
85
+ 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: {
@@ -38,6 +32,7 @@ const nextConfig: NextConfig = {
38
32
  { protocol: "https", hostname: "static-tmp.cimplify.io", pathname: "/**" },
39
33
  { protocol: "https", hostname: "storefrontassetscdn.cimplify.io", pathname: "/**" },
40
34
  { protocol: "https", hostname: "cdn.cimplify.io", pathname: "/**" },
35
+ { protocol: "https", hostname: "res.cloudinary.com", pathname: "/cimplify/**" },
41
36
  ],
42
37
  },
43
38
  };
@@ -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 (restaurant: Mama's Kitchen).
5
+ # Business id used by the mock seed (default: Mama's Kitchen).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_mamas_kitchen
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_mamas_kitchen
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: {
@@ -38,6 +32,7 @@ const nextConfig: NextConfig = {
38
32
  { protocol: "https", hostname: "static-tmp.cimplify.io", pathname: "/**" },
39
33
  { protocol: "https", hostname: "storefrontassetscdn.cimplify.io", pathname: "/**" },
40
34
  { protocol: "https", hostname: "cdn.cimplify.io", pathname: "/**" },
35
+ { protocol: "https", hostname: "res.cloudinary.com", pathname: "/cimplify/**" },
41
36
  ],
42
37
  },
43
38
  };
@@ -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 (retail: Currents Electronics).
5
+ # Business id used by the mock seed (default: Currents Electronics).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_currents_electronics
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
71
  - NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_currents_electronics
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: {
@@ -38,6 +32,7 @@ const nextConfig: NextConfig = {
38
32
  { protocol: "https", hostname: "static-tmp.cimplify.io", pathname: "/**" },
39
33
  { protocol: "https", hostname: "storefrontassetscdn.cimplify.io", pathname: "/**" },
40
34
  { protocol: "https", hostname: "cdn.cimplify.io", pathname: "/**" },
35
+ { protocol: "https", hostname: "res.cloudinary.com", pathname: "/cimplify/**" },
41
36
  ],
42
37
  },
43
38
  };
@@ -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 (services: Serene Spa).
5
+ # Business id used by the mock seed (default: Serene Spa).
11
6
  NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_serene_spa
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_serene_spa
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: {
@@ -38,6 +32,7 @@ const nextConfig: NextConfig = {
38
32
  { protocol: "https", hostname: "static-tmp.cimplify.io", pathname: "/**" },
39
33
  { protocol: "https", hostname: "storefrontassetscdn.cimplify.io", pathname: "/**" },
40
34
  { protocol: "https", hostname: "cdn.cimplify.io", pathname: "/**" },
35
+ { protocol: "https", hostname: "res.cloudinary.com", pathname: "/cimplify/**" },
41
36
  ],
42
37
  },
43
38
  };