Svelte Commerce × OroCommerce
Svelte Commerce on OroCommerce
OroCommerce’s storefront API speaks JSON:API, and the connector ships a deserialiser that resolves included relationships. Cart, checkout and sign-in are wired; reviews, wishlist, currencies and vendors are the gaps.
- 21/43 services wired
- @misiki/orocommerce-connector 0.4.0
- Cart wired
- Checkout wired
- Sign-in (auth) wired
What works on OroCommerce today
Cart, checkout and sign-in are wired; reviews, wishlist, currencies and vendors are not. There is no cash on delivery — OroCommerce has no such payment method — so orders go through Oro’s PayPal Express or Stripe checkout.
Cart
Wired: issues a real request to OroCommerce.
Checkout
Wired: issues a real request to OroCommerce.
Sign-in (auth)
Wired: issues a real request to OroCommerce.
Known gaps: review, wishlist, currency, vendor — each is explained under Limitations below.
21 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 OroCommerce. You need Node.js and a OroCommerce to point it at; the storefront holds no data of its own.
Clone it, choose the connector, point it at OroCommerce
# 1 — get the storefront
git clone https://github.com/itswadesh/svelte-commerce
cd svelte-commerce
# 2 — one connector at a time: remove the two the storefront ships with, add this one
npm uninstall @misiki/litekart-connector @misiki/vendure-connector
npm i @misiki/orocommerce-connector
# 3 — point it at your OroCommerce website
echo PUBLIC_OROCOMMERCE_API_URL=https://your-store.example.com >> .env
echo PUBLIC_OROCOMMERCE_API_KEY=... >> .env
echo PUBLIC_OROCOMMERCE_API_SECRET=... >> .env
# 4 — run it
npm run dev The guide removes only @misiki/litekart-connector. A fresh clone’s package.json also lists @misiki/vendure-connector, and with two connectors installed and neither of them Litekart’s, the build stops and asks for PUBLIC_CONNECTOR — so this removes both.
Environment variables
| Variable | Required | What it does |
|---|---|---|
PUBLIC_OROCOMMERCE_API_URL | Yes | The website origin: the storefront JSON:API lives at {url}/api and the token endpoint at {url}/oauth2-token. Boot fails, naming this variable, if it is missing. |
PUBLIC_OROCOMMERCE_API_KEY | No | OAuth2 client_id. |
PUBLIC_OROCOMMERCE_API_SECRET | No | OAuth2 client_secret. See the limitations. |
PUBLIC_OROCOMMERCE_ACCESS_TOKEN | No | Sent as a bearer token when set. |
PUBLIC_OROCOMMERCE_LOCALIZATION_ID | No | Sent as X-Localization-ID: the locale every localised field comes back in. |
PUBLIC_OROCOMMERCE_CURRENCY | No | Sent as X-Currency. OroCommerce Enterprise only; Community Edition ignores it. |
PUBLIC_OROCOMMERCE_PRODUCT_ID_MODE | No | sku addresses products by SKU instead of numeric ID, sent as X-Product-ID: sku on every request. |
PUBLIC_CONNECTOR | No | Only when more than one connector is installed: @misiki/orocommerce-connector names the one this build runs on. |
init.ts hands the connector every PUBLIC_OROCOMMERCE_* variable that is set, camel-cased. The guide also lists PUBLIC_OROCOMMERCE_STORE_ID and PUBLIC_OROCOMMERCE_CHANNEL_ID, which Oro ignores — it resolves the website from the request’s host — and PUBLIC_OROCOMMERCE_ACCESS_KEY, which the connector’s source does not read.
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 OroCommerce
- Create an OAuth application for the storefront API; its client ID and secret go in
PUBLIC_OROCOMMERCE_API_KEYandPUBLIC_OROCOMMERCE_API_SECRET— read the limitations first. - Configure PayPal Express or Stripe on the Oro side if shoppers are to pay: OroCommerce has no cash-on-delivery method, and the storefront’s cash-on-delivery option throws.
- Let the storefront’s origin make cross-origin requests to OroCommerce (CORS): in production the browser calls
PUBLIC_OROCOMMERCE_API_URLdirectly, not only the server.
How the integration works
Oro’s storefront API answers in JSON:API, and the connector resolves included relationships with its own deserialiser (the jsonapi file in its source is that helper, not a service). The website is resolved from the request’s host; locale, currency and SKU addressing travel as Oro’s documented headers. Payment goes through Oro’s checkout endpoints for PayPal Express and Stripe.
Installing the package is the whole switch. vite.config.ts resolves whichever @misiki/*-connector is installed, and src/lib/core/connectors/init.ts hands it every PUBLIC_OROCOMMERCE_* variable that is set, camel-cased, at boot — in the server hook for server rendering and in the client hook for the browser, which must reach the same URL in production.
There is no Litekart API behind the storefront here, so store identity — name, logo, currency, menus, plugin toggles, theme colours — comes 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”. Any Litekart REST path the connector still inherits is answered from that local data, or resolved empty, rather than requested.
Limitations
- No cash on delivery: OroCommerce has no such payment method, so the storefront’s cash-on-delivery option throws
NotSupportedError. - Reviews: not wired.
- Wishlist: not wired.
- Currencies: not wired.
- Vendors: not wired.
- Pages that depend on a service that is not wired render their empty state rather than failing.
- The OAuth client ID and secret come from
PUBLIC_OROCOMMERCE_API_KEYandPUBLIC_OROCOMMERCE_API_SECRET. SvelteKit sendsPUBLIC_variables to the browser, so every visitor can read them. - Homepage sections other than the live product list come from the active theme’s static content — the standing rule for themes.
- The Conversational Shopping assistant is Litekart-only; its widget stays hidden when another connector is active.
Troubleshooting
| When you see | What to do |
|---|---|
| Boot fails with “the orocommerce connector is active but PUBLIC_OROCOMMERCE_API_URL is not set” | Add PUBLIC_OROCOMMERCE_API_URL to .env. A production Node build and Docker read PUBLIC_* from the process environment rather than .env, so set it on your deploy platform too. |
| The build stops with “Several commerce connectors are installed … Set PUBLIC_CONNECTOR to pick one” | More than one @misiki/*-connector is in package.json and none is Litekart’s. Uninstall the ones you do not run — a fresh clone also lists @misiki/vendure-connector — or set PUBLIC_CONNECTOR='@misiki/orocommerce-connector'. |
| Boot fails with “PUBLIC_…_API_URL is set, but it configures a different backend than the one this build runs on” | Another backend’s variable is still set, usually left over from the one you switched from. Remove it, or install that backend’s connector. PUBLIC_LITEKART_API_URL is exempt: it only points the dev proxy. |
| The store is called “Test”, or shows the wrong name and logo | Store identity is static on this backend. Set name, logo, currencyCode and the rest in the default export of kitcommerce.config.ts; src/lib/core/connectors/default-store.json lists every field. |
[orocommerce] no native implementation for get /api/... in the console | The 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 OroCommerce has no such feature; if it has one, the fix belongs in the connector’s matching service. |
http proxy error: api/... ECONNREFUSED in dev | A Litekart REST path was requested from outside the connector, so its guard never saw it. Vite proxies /api to PUBLIC_LITEKART_API_URL, or to localhost:7000. |
The build fails on @misiki/litekart-connector | @misiki/kitcommerce-core declares it as a peer, and vite.config.ts redirects that specifier to whichever connector is installed. Make sure exactly one @misiki/*-connector is listed in package.json. |
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 correctionFAQ
Questions about Svelte Commerce on OroCommerce
Can I run an OroCommerce store on Svelte Commerce today?
Cart, checkout and sign-in are wired; reviews, wishlist, currencies and vendors are not, and there is no cash on delivery. Like every connector, it has not been run against a live production OroCommerce store.
How do I switch Svelte Commerce to OroCommerce?
Remove the connectors the storefront ships with, install @misiki/orocommerce-connector, set PUBLIC_OROCOMMERCE_API_URL in .env and start the dev server. vite.config.ts resolves whichever connector is installed, so no file in the storefront changes.
How do shoppers pay on OroCommerce?
Through Oro’s own checkout endpoints for PayPal Express and Stripe. OroCommerce has no cash-on-delivery payment method, so that option in the storefront throws rather than pretend.
Has the OroCommerce connector been run against a real OroCommerce store?
Not against a live production instance — no Svelte Commerce connector has been. It was written by reading OroCommerce’s authoritative API source, and the Svelte Commerce maintainers ask OroCommerce’s own maintainers for a sandbox to run it against.
Sources
This page summarises OROCOMMERCE.md in the Svelte Commerce repository and the OroCommerce 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. OroCommerce 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. OROCOMMERCE.md has the OroCommerce setup in full, beside the connector’s source.