Svelte Commerce × nopCommerce

Svelte Commerce on nopCommerce

nopCommerce core ships no REST API, so this connector targets the Web API Frontend plugin’s contract, v4.50.09 from 2022. Browsing, cart and sign-in are wired; the storefront cannot place an order on it yet.

What works on nopCommerce today

Browsing, cart and sign-in are wired, but the storefront cannot complete an order yet. nopCommerce checks out in five steps through its plugin, with payment chosen by a payment plugin’s system name. The connector wires those steps as nopCommerce-native methods, but the storefront’s payment step calls one method per gateway, and each of those throws NotSupportedError.

Cart

Wired: issues a real request to nopCommerce.

Checkout

Wired: issues a real request to nopCommerce.

Sign-in (auth)

Wired: issues a real request to nopCommerce.

Known gaps: coupon, currency — each is explained under Limitations below.

24 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 nopCommerce. You need Node.js and a nopCommerce to point it at; the storefront holds no data of its own.

Clone it, choose the connector, point it at nopCommerce

# 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/nopcommerce-connector

# 3 — point it at your nopCommerce store
echo PUBLIC_NOPCOMMERCE_API_URL=https://your-store.example.com >> .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

What Svelte Commerce reads to reach nopCommerce
VariableRequiredWhat it does
PUBLIC_NOPCOMMERCE_API_URLYesBase URL of the nopCommerce store running the Web API Frontend plugin. Boot fails, naming this variable, if it is missing.
PUBLIC_NOPCOMMERCE_ACCESS_TOKENNoA customer token to start from. Without one, the connector requests a guest token before the first cart or wishlist call.
PUBLIC_CONNECTORNoOnly when more than one connector is installed: @misiki/nopcommerce-connector names the one this build runs on.

init.ts hands the connector every PUBLIC_NOPCOMMERCE_* variable that is set, camel-cased. The guide also lists PUBLIC_NOPCOMMERCE_API_KEY, PUBLIC_NOPCOMMERCE_API_SECRET, PUBLIC_NOPCOMMERCE_ACCESS_KEY, PUBLIC_NOPCOMMERCE_STORE_ID and PUBLIC_NOPCOMMERCE_CHANNEL_ID; the connector’s source does not read them.

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 nopCommerce

How the integration works

The connector speaks the Web API Frontend plugin’s contract (v4.50.09, 2022), not nopCommerce core, which has no REST API. A shopper who has not signed in gets a guest token before the first cart call, and tokens travel as Authorization: Bearer.

Checkout in nopCommerce is five steps — billing address, shipping method, payment method, payment info, confirm — with the payment chosen by a payment plugin’s system name, and redirect gateways finishing on the store’s own return URL. The connector wires those steps as nopCommerce-native methods; the storefront’s per-gateway methods throw NotSupportedError, because an empty answer from a checkout call reads as “payment started”.

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_NOPCOMMERCE_* 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

Troubleshooting

Errors you may meet running Svelte Commerce on nopCommerce, and what fixes them
When you seeWhat to do
Every authenticated call returns 401The connector sends Authorization: Bearer <token>, as the plugin’s security scheme describes; the plugin’s own curl example sends the bare token. If your store expects the bare token, set BaseService.AUTH_RAW_TOKEN = true once at startup.
Boot fails with “the nopcommerce connector is active but PUBLIC_NOPCOMMERCE_API_URL is not set”Add PUBLIC_NOPCOMMERCE_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/nopcommerce-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 logoStore 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.
[nopcommerce] 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 nopCommerce has no such feature; if it has one, the fix belongs in the connector’s matching service.
http proxy error: api/... ECONNREFUSED in devA 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.

An open question for nopCommerce’s maintainers: If there is a published API contract newer than Web API Frontend v4.50.09, where is it?

Offer a sandbox or a correction

FAQ

Questions about Svelte Commerce on nopCommerce

Can I run a nopCommerce store on Svelte Commerce today?

Not to take orders. Browsing, cart and sign-in are wired through the Web API Frontend plugin, but the storefront’s payment step calls per-gateway methods that throw on nopCommerce. The connector wires nopCommerce’s own five-step checkout; the storefront does not call it yet.

How do I switch Svelte Commerce to nopCommerce?

Remove the connectors the storefront ships with, install @misiki/nopcommerce-connector, set PUBLIC_NOPCOMMERCE_API_URL in .env and start the dev server. vite.config.ts resolves whichever connector is installed, so no file in the storefront changes.

Does nopCommerce need a plugin for Svelte Commerce?

Yes. nopCommerce core ships no REST API, so the connector targets the Web API Frontend plugin’s contract, version 4.50.09 from 2022, which needs the Web API Framework plugin too. If a newer contract is published, the Svelte Commerce maintainers have asked to be pointed at it.

Has the nopCommerce connector been run against a real nopCommerce store?

Not against a live production instance — no Svelte Commerce connector has been. It was written by reading nopCommerce’s authoritative API source, and the Svelte Commerce maintainers ask nopCommerce’s own maintainers for a sandbox to run it against.

Sources

This page summarises NOPCOMMERCE.md in the Svelte Commerce repository and the nopCommerce 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. nopCommerce 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. NOPCOMMERCE.md has the nopCommerce setup in full, beside the connector’s source.

Chat on WhatsApp