Skip to main content
Cursor is an AI-first editor that can read your repo, write new files, and run shell commands. Paste the prompt below in the composer to add a Lumx integration to any TypeScript or JavaScript project — server routes, helper, and a starter UI.

Prerequisites

  • A Lumx account with a Sandbox API key
  • Cursor installed and pointed at a project with a server-side runtime (Next.js, Remix, Express, SvelteKit, FastAPI, Django, Rails, etc.)
  • A local env file (.env.local, .env, or framework equivalent) the project already reads at runtime

Step 1 — Get your Lumx credentials

From the Lumx Dashboard, open Developers → API Keys and copy a Sandbox key. See Authentication. Keys are only shown once.

Step 2 — Store the key locally

Add the secrets to your project’s env file. Keep the file out of git.
.env.local
LUMX_API_KEY=lumx_sk_sandbox_xxxxxxxxxxxxxxxx
LUMX_ENV=sandbox
.gitignore (append if missing)
.env
.env.local
.env*.local
Cursor can read any file in your project. Make sure .env.local is gitignored before you commit — and never paste your key into the composer.

Step 3 — Hook up the Lumx docs MCP

The Lumx documentation ships as an MCP server so Cursor can pull endpoint shapes and field definitions on demand — no copying schemas into the prompt. Add this to .cursor/mcp.json:
.cursor/mcp.json
{
  "mcpServers": {
    "lumx-docs": {
      "url": "https://docs.lumx.io/mcp"
    }
  }
}
Restart Cursor. The composer will now answer questions like “what fields does POST /transactions/on-ramp accept?” by querying the docs directly.

Step 4 — Paste the prompt

Open the composer (Cmd+I / Ctrl+I) and paste:
Lumx integration prompt
Add a stablecoin payments backend that uses the Lumx API. Lumx
connects local banking rails to stablecoins so I can collect, hold,
convert, and pay out money in either form.

Rules
- Read LUMX_API_KEY from environment variables (process.env in Node,
  os.environ in Python, ENV in Ruby, etc.). Never expose it in
  client-side code. Always call Lumx from server routes.
- Pick the base URL from LUMX_ENV. Default to
  https://api-sandbox.lumx.io. Use https://api.lumx.io when LUMX_ENV
  is "production".
- Send every request with the headers:
    Authorization: Bearer ${LUMX_API_KEY}
    Content-Type: application/json
- On non-2xx responses, surface the Lumx error body and HTTP status.
  Do not retry 4xx.

Match the project's existing conventions
- Detect the project's language and framework first, then write
  idiomatic code for that stack (Next.js app router, Remix loaders,
  Express routes, FastAPI routers, Django views, Rails controllers,
  etc.).
- Reuse the project's existing HTTP client, error helper, or
  validation library if one already exists.

Server routes to build
1. POST /api/customers — calls Lumx POST /customers. Body: type
   ("INDIVIDUAL" or "BUSINESS"), name, taxId, country (ISO-3), email.
   Returns the Lumx customer record including verification.link.
2. POST /api/on-ramp — calls Lumx POST /transactions/on-ramp. Body:
   customerId, currency (ISO-3), amount (string). Returns the
   rail-specific deposit instructions.
3. GET /api/transactions/:id — calls Lumx GET /transactions/:id and
   returns the transaction's current status and timeline.

UI to build (only if the project already has a frontend)
- Customer onboarding screen: form that calls POST /api/customers,
  then renders verification.link as a button.
- On-ramp deposit screen: form that picks a customer, sets a
  currency and amount, calls POST /api/on-ramp, then renders the
  returned deposit instructions.

Reference: https://docs.lumx.io

Step 5 — Review the diff

Cursor will propose file changes. Reject any that put the API key in client-side code or that hardcode endpoints — both are common drifts when the agent rushes. Accept the rest, run the project, and walk the flow end-to-end.

Example: a server-side Lumx helper

If you’d rather drop this in by hand, here’s the shape the prompt aims for.
server/lumx.ts
const LUMX_BASE =
  process.env.LUMX_ENV === "production"
    ? "https://api.lumx.io"
    : "https://api-sandbox.lumx.io";

async function lumx(path: string, init?: RequestInit) {
  const res = await fetch(`${LUMX_BASE}${path}`, {
    ...init,
    headers: {
      Authorization: `Bearer ${process.env.LUMX_API_KEY}`,
      "Content-Type": "application/json",
      ...init?.headers,
    },
  });
  if (!res.ok) {
    throw new Error(`Lumx ${res.status}: ${await res.text()}`);
  }
  return res.json();
}

export const createCustomer = (input: {
  type: "INDIVIDUAL" | "BUSINESS";
  name: string;
  taxId: string;
  country: string;
  email: string;
}) => lumx("/customers", { method: "POST", body: JSON.stringify(input) });

export const createOnRamp = (input: {
  customerId: string;
  currency: string;
  amount: string;
}) =>
  lumx("/transactions/on-ramp", {
    method: "POST",
    body: JSON.stringify(input),
  });

export const getTransaction = (id: string) => lumx(`/transactions/${id}`);

FAQ

Yes. Add a rule that says “Lumx calls only run server-side. Never reference process.env.LUMX_API_KEY from a file that ends up in the browser bundle.” Cursor will apply it to every follow-up edit.
Reject the change and add .env*.local to .gitignore first. If the file was already committed, rotate the key in the Dashboard and remove the file with git rm --cached .env.local.
Replace LUMX_API_KEY with a Production key and set LUMX_ENV=production. Production access requires a call with the Lumx team — see Environments.
Yes. The prompt explicitly asks the agent to match your router style and reuse any fetch wrapper that’s already in the repo, so it slots into existing codebases without inventing new patterns.

Next steps

  • Create a customer — full reference for the customer payload
  • Webhooks — subscribe to status changes instead of polling
  • MCP server — connect Cursor to Lumx’s docs MCP for inline answers