All posts
Guides9 min read

Build a custom storefront with Lovable or v0 — one prompt

Vibe-code a custom Quickshops storefront with Lovable, v0.dev, or Cursor. Use @quickshops/sdk on the server, keep your API key off the client, and return buyers to your own success page.

ValtteriFounder

You can vibe-code a custom storefront and still let Quickshops run checkout.

Open Lovable, v0.dev, Cursor, or Bolt. Paste one prompt. Point the app at your Pro API key. You get a site that looks like your brand — while products, cart, Stripe Checkout, and delivery stay on Quickshops via @quickshops/sdk.

That is headless commerce for the AI age: you design the front; we stay the commerce brain.

Why headless + AI builders now

AI coding tools are finally good at SSR apps, Route Handlers, and cookie-backed sessions. They are still bad at inventing payment systems.

That split is useful. Let the agent own layout, typography, and cart UX. Do not let it invent card forms or order databases. Point it at a real SDK that already knows your catalog and your Stripe Connect account.

Quickshops already does that for the hosted storefront. The same stack is available for custom sites:

  • TypeScript SDK @quickshops/sdk with useStore() (preferred)
  • Optional UI @quickshops/sdk/react (Storefront.* composition primitives, CheckoutSuccess)
  • Bearer API keys (qk_...) on Pro
  • Buy-now checkout → Stripe-hosted payment page → your success URL

You keep creative control. You do not rebuild payments. Prefer useStore() + /react over hand-rolled REST or redirect strings.

What Quickshops provides

Think of Quickshops as the backend your vibecoded UI plugs into.

You designQuickshops owns
Pages, brand, product presentationProduct catalog and prices in the dashboard
Cart UI and navigationCart persistence via the SDK
Success / cancel pages on your domainStripe Checkout session + redirect URL
Optional post-purchase automationOrder email delivery / subscription activation
Webhooks such as order.completed

Flow stays simple:

  1. Your server calls store.loadCatalog()
  2. Your server calls store.buyNow({ productId }) (or optional cart helpers)
  3. The browser redirects to the Stripe Checkout URL
  4. Stripe returns the customer to your success page
  5. Your success page calls store.getCheckoutSession(sessionId)

Payment UI stays on Stripe. Digital delivery stays on Quickshops. Your site never sees raw card data.

One-prompt install

Paste the master prompt from docs.quickshops.app/sdk/one-prompt-storefront into Lovable, v0, or Cursor.

That guide covers:

  • Prerequisites (Pro, API key, Stripe Connect)
  • Env vars (HEADLESS_API_KEY, optional HEADLESS_API_URL, SITE_URL)
  • The hard rule: key never in the client; commerce via useStore()
  • Optional UI via @quickshops/sdk/react (Storefront.Provider + slots; pass Server Actions as actions)
  • Buy-now default (store.buyNow) — no cart cookie required
  • Success-page status via store.getCheckoutSession
  • A pasteable master prompt for Lovable / v0 / Bolt / Cursor

Optional for agents:

npx skills add valtterisa/quickshops --skill quickshops-headless-storefront

Your job as the human: upgrade to Pro, connect Stripe, issue a key under Settings → API keys, paste the master prompt, set env vars.

How it works with Lovable and v0 (SSR BFF)

Lovable and v0 like shipping interactive React. That is fine for buttons and layout. It is wrong for API keys.

Use a BFF (backend-for-frontend):

Browser  →  your /api or Server Actions  →  @quickshops/sdk (qk_...)  →  Stripe

In Next.js App Router terms:

  • Instantiate @quickshops/sdk in a file with import "server-only"
  • Read/write the cart from Server Actions or Route Handlers
  • Pass catalog data into @quickshops/sdk/react (Storefront.Provider + composition slots)
  • On checkout, create the session on the server, then redirect() (or return { url } for window.location)

Never call api.quickshops.app from a "use client" module. Never put HEADLESS_API_KEY in NEXT_PUBLIC_*. Do not teach the agent to fetch REST paths when the SDK covers the call.

Custom return URLs

Do not assemble redirect URLs yourself. useStore() reads SITE_URL and sets absolute return URLs for you.

const { buyNow } = useStore();
const { url } = await buyNow({ productId: "prod_01j..." });

Step-by-step

  1. Upgrade to ProAccount → Billing. API keys are Pro-only.
  2. Connect Stripe — under Payments. Without Connect, checkout returns a conflict.
  3. Publish products — at least one active digital or subscription product.
  4. Issue an API keySettings → API keys. Copy the qk_... value once.
  5. Open your AI builder — Lovable, v0.dev, Cursor, or Bolt with a Next.js App Router project.
  6. Paste the master prompt from the one-prompt docs.
  7. Set env vars on the host:
HEADLESS_API_KEY=qk_...
HEADLESS_API_URL=https://api.quickshops.app
SITE_URL=https://your-deployed-storefront.example
  1. Buy something in test — add to cart, checkout, complete Stripe test payment, land on /success.
  2. Optional: webhooksSettings → Webhooks, subscribe to order.completed if your app needs a server-side order hook.

Docs: SDK install and API overview (REST reference — prefer the SDK in apps).

What stays on Quickshops vs what you design

Stays on Quickshops

  • Catalog edits (dashboard, AI Chat, MCP, Telegram — same store)
  • Pricing, discounts configured in-product
  • Stripe Connect and Checkout
  • Order records and buyer email delivery
  • Subscription lifecycle and member portal APIs
  • Webhook delivery (order.completed, subscription events)

You design

  • Marketing pages and product presentation
  • Navigation, cart drawer, empty states
  • Success and cancel experiences on your domain
  • Any CMS, blog, or community around the shop

You can keep using the hosted Quickshops storefront for one audience and a vibecoded site for another. Both can sell the same catalog through the same store and Stripe account.

Who this is for

  • Creators who want a fully custom look without rebuilding payments
  • Teams already living in Lovable, v0, or Cursor
  • Sellers on Pro who already use API keys for MCP or automation

Who should skip it

If the built-in storefront and themes are enough, stay there. Headless is optional power, not a requirement to sell.

Pro plan

API keys, MCP, and Telegram are Pro features.

Free still includes your hosted storefront, Stripe checkout, and in-app AI Chat with trial messages. Pro unlocks the integrations that meet you where you already work — including the headless API and @quickshops/sdk for custom storefronts.

See pricing for the comparison.

Start building

  1. Upgrade to Pro if needed
  2. Connect Stripe and issue a key under Settings → API keys
  3. Follow the one-prompt storefront guide
  4. Paste the master prompt into Lovable, v0, or Cursor

SDK: docs.quickshops.app/sdk/installation

If something fails at checkout, check the docs error table first (401 key, Pro required, empty cart, mixed subscription cart, missing Stripe). If you are still stuck, email valtteri@quickshops.app with your setup (builder + framework) and the error code.

FAQ

Frequently asked questions

How custom storefronts work with Lovable, v0, @quickshops/sdk, API keys, and Stripe Checkout return URLs.

Yes, if you are on Pro with Stripe connected and an API key ready. Paste the master prompt from docs.quickshops.app/sdk/one-prompt-storefront into Lovable, v0.dev, Cursor, or Bolt. The agent scaffolds an SSR site that talks to Quickshops through @quickshops/sdk for products, cart, and checkout.
You need to create a Pro API key and set environment variables. The AI builder writes the TypeScript. You should still understand that your API key stays on the server — never in the browser.
No. Headless API keys are a Pro feature. The Free plan still includes the built-in Quickshops storefront, Stripe checkout, and in-app AI Chat. Upgrade under Account → Billing before issuing a key.
API keys authenticate as your store. If you put a qk_ key in client code, anyone can scrape it and act as your store. Always use a BFF pattern: the browser talks to your Next.js server actions or Route Handlers; your server uses @quickshops/sdk.
Absolute https return URLs for Stripe after pay or cancel. Do not build them by hand — call store.buyNow() from useStore(); it sets /success?session_id={CHECKOUT_SESSION_ID} and /cart from SITE_URL.
Yes. Stripe still hosts payment. After a successful one-time purchase, Quickshops records the order and emails the download. For subscriptions, access is activated the same way as on the hosted storefront. Use the order.completed webhook if your custom app needs a post-purchase hook.
No. Subscription products must be purchased alone with quantity 1. Your custom UI should prevent mixed carts the same way the hosted storefront does.
docs.quickshops.app/sdk/one-prompt-storefront has the master prompt, env vars, and the useStore() hello-world (loadCatalog → buyNow → getCheckoutSession).

Run your store from chat

Sign up free, connect Stripe, and publish your first product. Describe an update, review the plan, and go live without juggling admin tabs.

Get started(opens in a new tab)

No credit card required