Svelte Commerce × Vendure

Svelte Commerce on Vendure

Vendure’s GraphQL Shop API covers almost the whole storefront surface, which puts this connector level with Litekart as the most complete of the 26. Products, cart, checkout, sign-in, orders and addresses come live from Vendure; store identity and CMS-style content come from the storefront’s own config.

What works on Vendure today

As complete as any connector here: 39 of 43 services, with cart, checkout and sign-in wired. What the connector does not implement for Vendure yet — wishlist, reviews, coupons, CMS pages, several currencies, multi-vendor — renders an empty state rather than an error.

Cart

Wired: issues a real request to Vendure.

Checkout

Wired: issues a real request to Vendure.

Sign-in (auth)

Wired: issues a real request to Vendure.

Known gaps: none recorded.

39 of 43 services wired, read from CONNECTORS.md on , where the package version is recorded too; npm may carry a newer patch. Coverage is traced by a script in the Svelte Commerce repository: a service counts as wired only if it transitively issues an HTTP request, or delegates to one that does. It is not hand-asserted. Some services are Litekart-native concepts with no equivalent elsewhere (reels, deals, chat, gallery, popularity, demo-request, feedback, plugins, banner). They stay documented placeholders on every connector and are excluded from known gaps.

Quick start

From nothing to a Svelte Commerce storefront reading Vendure. You need Node.js and a Vendure to point it at; the storefront holds no data of its own.

Clone it, choose the connector, point it at Vendure

# 1 — get the storefront
git clone https://github.com/itswadesh/svelte-commerce
cd svelte-commerce

# 2 — swap the stock connector for Vendure’s
npm uninstall @misiki/litekart-connector
npm i @misiki/vendure-connector

# 3 — point it at your Vendure server
echo PUBLIC_VENDURE_API_URL=http://localhost:3000 >> .env

# 4 — run it
npm run dev

The GraphQL endpoint is resolved as <PUBLIC_VENDURE_API_URL>/shop-api, so give the server’s base URL, not the endpoint.

Environment variables

What Svelte Commerce reads to reach Vendure
VariableRequiredWhat it does
PUBLIC_VENDURE_API_URLYesBase URL of the Vendure server. GraphQL calls go to <this URL>/shop-api.
PUBLIC_CONNECTORNoOnly when more than one connector is installed: @misiki/vendure-connector names the one this build runs on.

The Litekart trio — PUBLIC_LITEKART_API_URL, PUBLIC_LITEKART_STORE_ID, PUBLIC_LITEKART_DOMAIN — is not needed in Vendure mode; /health reports ready as soon as PUBLIC_VENDURE_API_URL is set.

Every variable here begins PUBLIC_, and SvelteKit sends PUBLIC_ variables to the browser: treat each value you set as published.

What to set up on Vendure

How the integration works

At boot, init in both src/hooks.server.ts and src/hooks.client.ts reads PUBLIC_VENDURE_API_URL and hands it to the connector’s setBaseUrl(). Both hooks matter: the server hook covers server rendering, the client hook covers the browser, which must reach the public Vendure URL in production.

Products, categories (Vendure collections), search, cart, checkout, payment methods, orders, sign-in, profile and addresses all go to Vendure’s Shop API. Checkout attaches the customer before payment — an order cannot reach ArrangingPayment without one — and carries Vendure’s order code out as the order number.

Store identity, menus and plugin toggles come from src/lib/core/connectors/default-store.json merged under the default export of kitcommerce.config.ts; until you override it, the store is called “Test”. CMS pages and the blog resolve empty. From connector 2.0.39 the REST paths it once inherited from Litekart are answered by the connector itself.

Two defaults in that static config shape what shoppers see. The search icon in the navigation is hidden (plugins.search.active is false, because autocomplete is Litekart’s Meilisearch), though Vendure’s own search still powers the /products page. And sign-in offers email and password only (loginType is EMAIL): Vendure has no OTP, while email sign-in, sign-up, sign-out and password reset are native GraphQL.

Limitations

Troubleshooting

Errors you may meet running Svelte Commerce on Vendure, and what fixes them
When you seeWhat to do
Boot fails with “PUBLIC_VENDURE_API_URL is set, but it configures a different backend than the one this build runs on”The variable is set while a different connector is installed — the stock Litekart one, say. Install @misiki/vendure-connector, or remove the variable if you meant to run Litekart. With more than one connector installed, set PUBLIC_CONNECTOR='@misiki/vendure-connector'.
[vendure] no native implementation for get /api/... in the consoleThe connector’s REST guard caught a path inherited from Litekart and answered it empty instead of requesting it. Each path is reported once. Harmless if Vendure has no such feature; if it has one, implement it in the connector’s matching service.
http proxy error: api/... ECONNREFUSED in devA Litekart REST path was requested from outside the connector, so neither its guard nor blockRestFallbacks saw it. Vite proxies /api to PUBLIC_LITEKART_API_URL, or to localhost:7000.
The store is called “Test”, or shows the wrong brandingSet identity overrides — name, logo, favicon, currencyCode and the rest — in the default export of kitcommerce.config.ts.
Sign-in or cart works in dev but not when deployedAlmost always Vendure’s CORS: allow the deployed storefront’s origin with credentials, as described under the Vendure settings above.

Before you rely on it

The one caveat that matters

Read this before choosing

Every connector was written by reading its platform’s authoritative source — an OpenAPI spec, a RAML file, a router registration or the controller source — rather than by running against a store. No connector has been exercised against a live production instance of its platform.

Offer a sandbox or a correction

FAQ

Questions about Svelte Commerce on Vendure

Can I run a Vendure store on Svelte Commerce today?

It is the most complete option besides Litekart: 39 of 43 services, with cart, checkout and sign-in wired against Vendure’s GraphQL Shop API. What the connector does not implement for Vendure yet — wishlist, reviews, coupons, CMS pages, multi-vendor — shows an empty state. Like every connector, it has not been run against a live production Vendure store.

Which Vendure settings does Svelte Commerce need?

Two. Set authOptions.requireVerification to false, and allow the storefront’s origin in CORS with credentials — the exact origin, not *, with Access-Control-Allow-Credentials set to true.

Why does sign-in work locally but not once deployed?

Because the browser calls Vendure directly with credentials, and Vendure’s CORS settings must name the deployed storefront’s origin. Add it, with credentials allowed.

Does Svelte Commerce use Vendure’s search?

Yes, on the /products catalogue page. The search icon in the navigation is hidden by default, because that autocomplete is Litekart’s Meilisearch, which Vendure does not have.

Sources

This page summarises VENDURE.md in the Svelte Commerce repository and the Vendure connector’s source, read on , and the coverage in CONNECTORS.md, read on . Where they disagree with this page, they are right and this page is out of date. Vendure is a trademark of its owner, named here only to describe compatibility; no endorsement or affiliation is implied — see trademarks.

Read the whole guide

The storefront is the same on every backend; the connector is what changes. VENDURE.md has the Vendure setup in full, beside the connector’s source.

Chat on WhatsApp