From d82fc0a6afc978be2f94add9e5c8deec35a98af5 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 11 Sep 2026 16:54:48 +0200 Subject: [PATCH 1/2] =?UTF-8?q?docs(fiat-checkout):=20Orders=20is=20deploy?= =?UTF-8?q?ed=20in=20sandbox=20=E2=80=94=20point=20at=20the=20live=20endpo?= =?UTF-8?q?ints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fiat-checkout-chat tutorial said Orders was unshipped/local-only and the embed checkout lived on a branch (#3249). Both are now deployed in sandbox (api.sandbox.nevermined.app, embed.nevermined.app), so: - README: lead with the deployed sandbox endpoints; keep the local stack as a collapsible alternative; fix the sanity-check curl to use $NVM_API_BASE_URL - .env.example: default NVM_API_BASE_URL / NVM_EMBED_BASE_URL to the sandbox URLs - showcase tutorials.ts: the "See it run" note no longer says "local stack now" Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01GYjpDX5ZRMGrpSZ8zAMLg3 --- fiat-checkout-chat/.env.example | 10 +++---- fiat-checkout-chat/README.md | 53 ++++++++++++++++++++------------- showcase/content/tutorials.ts | 2 +- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/fiat-checkout-chat/.env.example b/fiat-checkout-chat/.env.example index b0c536b8..5ce89c7a 100644 --- a/fiat-checkout-chat/.env.example +++ b/fiat-checkout-chat/.env.example @@ -10,11 +10,11 @@ NVM_ORDER_API_KEY= # The Nevermined API the merchant backend calls to create orders. -# While the Orders feature (epic #3238) is unmerged, run the local API from the -# feature branch (see README) — it listens on :3001. -NVM_API_BASE_URL=http://localhost:3001 +# Orders (epic #3238) is deployed in sandbox; use it directly. For a local stack +# (see README) set http://localhost:3001 instead. +NVM_API_BASE_URL=https://api.sandbox.nevermined.app # Origin of the Nevermined HOSTED checkout the chat embeds in an iframe. The # browser also uses this exact value to verify event.origin on the success -# postMessage, so it must match the embed app's real origin. -NVM_EMBED_BASE_URL=http://localhost:4250 +# postMessage, so it must match the embed app's real origin. Local stack: http://localhost:4250 +NVM_EMBED_BASE_URL=https://embed.nevermined.app diff --git a/fiat-checkout-chat/README.md b/fiat-checkout-chat/README.md index 9f6f7c9f..2a4aacb2 100644 --- a/fiat-checkout-chat/README.md +++ b/fiat-checkout-chat/README.md @@ -73,14 +73,26 @@ chat — no login, no wallet, no crypto. ## Prerequisite: the Nevermined Orders backend -Orders is a **feature in progress** (epic -[#3238](https://github.com/nevermined-io/nvm-monorepo/issues/3238)) and is not yet in -a released sandbox/live environment, so run the backend **locally from -`nvm-monorepo`**. The `POST/GET /api/v1/orders` **API** is already merged to `main`; -the piece that is not is the **hosted embed checkout route** `/checkout/order/:orderId` -— it lives on branch **`aaitor/orders-embed-checkout-3249`** (issue -[#3249](https://github.com/nevermined-io/nvm-monorepo/issues/3249)), so build the stack -from that branch until it ships. You need three things listening: +Orders (epic [#3238](https://github.com/nevermined-io/nvm-monorepo/issues/3238)) is +now deployed in **sandbox** — both the `POST/GET /api/v1/orders` **API** and the +hosted embed checkout route `/checkout/order/:orderId` +([#3249](https://github.com/nevermined-io/nvm-monorepo/issues/3249)). So you don't +need to run anything locally: point the two URLs at the deployed sandbox endpoints +and only the org key is yours to supply. + +| Variable | Sandbox value | What it is | +|---|---|---| +| `NVM_API_BASE_URL` | `https://api.sandbox.nevermined.app` | serves `POST/GET /api/v1/orders` | +| `NVM_EMBED_BASE_URL` | `https://embed.nevermined.app` | the hosted Stripe form the chat iframes | + +You still need a provisioned **merchant org**: an active organization with a +**validated Stripe Connect account** and an **org-scoped API key** with ordering +enabled (`canOrder`) — that is your `NVM_ORDER_API_KEY`. + +
+Alternative: run the whole stack locally from nvm-monorepo + +You can also run the backend yourself — three things listening: | Service | Port | What it is | |---|---|---| @@ -88,17 +100,18 @@ from that branch until it ships. You need three things listening: | Hosted embed checkout | `4250` | the Stripe form the chat iframes | | Embed config server | `3000` | serves `/api/config` (Stripe publishable key, URLs) | -You also need a provisioned **merchant org**: an active organization with a -**validated Stripe Connect account** and an **org-scoped API key** with ordering -enabled (`canOrder`). See the epic and the `nvm-monorepo` run docs for the exact -build/migrate/seed steps. (Gotcha: the embed's dev server needs the runtime `dist` -of `@nevermined-io/commons`, `core-kit` and `ui-widgets` built first, or it renders -"Couldn't load the widget".) +Then set `NVM_API_BASE_URL=http://localhost:3001` and +`NVM_EMBED_BASE_URL=http://localhost:4250`. See the epic and the `nvm-monorepo` run +docs for the build/migrate/seed steps. (Gotcha: the embed's dev server needs the +runtime `dist` of `@nevermined-io/commons`, `core-kit` and `ui-widgets` built first, +or it renders "Couldn't load the widget".) + +
Sanity-check the backend before running the chat: ```bash -curl -sX POST http://localhost:3001/api/v1/orders \ +curl -sX POST "$NVM_API_BASE_URL/api/v1/orders" \ -H "Authorization: Bearer $NVM_ORDER_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"amountMinor":343795,"currency":"usd","description":"Barcelona trip"}' @@ -114,8 +127,8 @@ pnpm install # or npm install / yarn # 2. configure — copy the example and paste your ORG key (never commit .env.local) cp .env.example .env.local # NVM_ORDER_API_KEY = the organization's Nevermined API key (SECRET) -# NVM_API_BASE_URL = http://localhost:3001 (the Orders API) -# NVM_EMBED_BASE_URL = http://localhost:4250 (the hosted checkout origin) +# NVM_API_BASE_URL = https://api.sandbox.nevermined.app (the Orders API) +# NVM_EMBED_BASE_URL = https://embed.nevermined.app (the hosted checkout origin) # 3. run (http://localhost:3200) pnpm dev # or: pnpm build && pnpm start @@ -137,9 +150,9 @@ to the browser bundle. | Variable | Example | Notes | |---|---|---| -| `NVM_ORDER_API_KEY` | `sandbox-…` | **Secret.** The org's Nevermined API key. Only used in `/api/orders`. | -| `NVM_API_BASE_URL` | `http://localhost:3001` | The Nevermined API the backend calls. | -| `NVM_EMBED_BASE_URL` | `http://localhost:4250` | Origin of the hosted checkout; also the value the success listener checks `event.origin` against. | +| `NVM_ORDER_API_KEY` | `sandbox:…` | **Secret.** The org's Nevermined API key. Only used in `/api/orders`. | +| `NVM_API_BASE_URL` | `https://api.sandbox.nevermined.app` | The Nevermined API the backend calls (`http://localhost:3001` for a local stack). | +| `NVM_EMBED_BASE_URL` | `https://embed.nevermined.app` | Origin of the hosted checkout; also the value the success listener checks `event.origin` against (`http://localhost:4250` for a local stack). | ## The Orders API contract diff --git a/showcase/content/tutorials.ts b/showcase/content/tutorials.ts index 494a7915..24afb94b 100644 --- a/showcase/content/tutorials.ts +++ b/showcase/content/tutorials.ts @@ -1025,7 +1025,7 @@ window.addEventListener('message', (e) => { { id: "tokyo", name: "Tokyo Sushi Masterclass", amountMinor: 14500, blurb: "2 hours · chef-led", emoji: "🍣" }, { id: "safari", name: "Nairobi Day Safari", amountMinor: 32900, blurb: "full day · park entry + guide", emoji: "🦁" }, ], - note: "It needs a running Nevermined Orders backend + org key — the local stack now, the sandbox once Orders ships (epic #3238). The full source is in fiat-checkout-chat/.", + note: "Runs against the deployed Nevermined Orders sandbox (epic #3238) with an org key — no local stack needed. The full source is in fiat-checkout-chat/.", }, }, ]; From 95b741d7480cbf62797e9f24e6253a79d42bb699 Mon Sep 17 00:00:00 2001 From: Aitor <1726644+aaitor@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:05:05 +0200 Subject: [PATCH 2/2] docs(fiat-checkout): note embed host is network-neutral (review nit on #76) Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01GYjpDX5ZRMGrpSZ8zAMLg3 --- fiat-checkout-chat/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiat-checkout-chat/README.md b/fiat-checkout-chat/README.md index 2a4aacb2..c8308bfd 100644 --- a/fiat-checkout-chat/README.md +++ b/fiat-checkout-chat/README.md @@ -83,7 +83,7 @@ and only the org key is yours to supply. | Variable | Sandbox value | What it is | |---|---|---| | `NVM_API_BASE_URL` | `https://api.sandbox.nevermined.app` | serves `POST/GET /api/v1/orders` | -| `NVM_EMBED_BASE_URL` | `https://embed.nevermined.app` | the hosted Stripe form the chat iframes | +| `NVM_EMBED_BASE_URL` | `https://embed.nevermined.app` | the hosted Stripe form the chat iframes — one host serves both networks and follows the order's, so there is no `sandbox`-flavoured variant | You still need a provisioned **merchant org**: an active organization with a **validated Stripe Connect account** and an **org-scoped API key** with ordering