Svelte Commerce × Saleor

Svelte Commerce on Saleor

The Saleor connector talks to Saleor’s GraphQL API from a single environment variable. Its guide describes cart, checkout and sign-in as Saleor-native, but the coverage script counts none of the three as wired, so for now it cannot sell.

What works on Saleor today

Cannot sell yet. The coverage script counts cart, checkout and sign-in as not wired — along with orders, categories, coupons, search, addresses, pages and payment methods — and CONNECTORS.md says this connector predates the current wiring pass. Its own guide adds that the card gateways throw “not implemented”.

Cart

Not yet wired, by the coverage script’s measure.

Checkout

Not yet wired, by the coverage script’s measure.

Sign-in (auth)

Not yet wired, by the coverage script’s measure.

Known gaps: auth, cart, checkout, order, category, coupon, search, address, user, page, payment-method

28 of 43 services wired, read from CONNECTORS.md on ; npm may carry a newer patch. How coverage is measured.

What the connector calls on Saleor

The connector calls Saleor’s GraphQL API at the single endpoint given in PUBLIC_SALEOR_API_URL, through the graphql-request client, with every catalogue query scoped to the channel default-channel.

The connector sends no store credential, only the endpoint URL; when localStorage holds a saleor_token, each GraphQL request carries it as authorization: Bearer <token>, and Svelte Commerce’s coverage script does not count shopper sign-in as wired.

Requests the @misiki/saleor-connector source makes, by storefront service
ServiceWhat it requests
productquery ListProducts (products(first, channel, filter: { search, categories }), reading totalCount and edges.node)
productquery GetProduct (product(slug, channel)) for a product page
collectionquery ListCollections (collections(first, filter: { search }, channel)) and query GetCollection (collection(slug, channel))
profilequery GetMe (me) to read the profile and mutation AccountUpdate to save it

Saleor rules the connector follows

Read from the source of misiki-in/saleor-connector at commit 87c3f2e of . Where the code has changed since, the code is right.

Quick start

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

Clone it, choose the connector, point it at Saleor

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

# 3 — point it at your Saleor GraphQL endpoint
echo PUBLIC_SALEOR_API_URL=https://your-store.saleor.cloud/graphql/ >> .env

# 4 — run it
npm run dev

Switching works the same way on every backend: what all 26 share, from one connector at a time to store identity.

Environment variables

What Svelte Commerce reads to reach Saleor
VariableRequiredWhat it does
PUBLIC_SALEOR_API_URLYesThe full Saleor GraphQL endpoint, such as https://your-store.saleor.cloud/graphql/ — the endpoint, not just the host.
PUBLIC_CONNECTORNoOnly when more than one connector is installed: @misiki/saleor-connector names the one this build runs on.

The Litekart trio is not used in Saleor mode; /health reports ready when PUBLIC_SALEOR_API_URL is set and the Saleor connector is active.

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 Saleor

How the integration works

At boot, init in both hooks (through src/lib/core/connectors/init.ts) writes PUBLIC_SALEOR_API_URL onto the connector’s BaseService.SALEOR_API_URL. The server hook covers server rendering; the client hook covers the browser, which must reach the public Saleor URL in production.

By the guide’s account, cart, shipping rates, payment-method listing and cash-on-delivery checkout are Saleor-native GraphQL; categories map to Saleor categories; and the profile page delegates to Saleor’s me and accountUpdate. checkoutComplete requires an email on the checkout, so the static store config defaults isEmailMandatory to true.

Store identity, menus and plugin toggles are static — default-store.json under the default export of kitcommerce.config.ts. CMS pages are the connector’s own static placeholders. Any other Litekart REST path is never requested: list reads resolve empty, single-record reads and writes throw. From connector 1.0.4 the store lookup it once inherited from Litekart is answered by the connector itself.

The coverage script and the guide disagree. The script counts a service as wired only if it reaches the connector’s own HTTP layer, and it does not count auth, cart, checkout, order, category, coupon, search, address, user, page or payment-method. CONNECTORS.md names Medusa and Saleor as the next candidates for the source-verification sweep.

Limitations on Saleor

Troubleshooting Saleor

Errors particular to Svelte Commerce on Saleor, and what fixes them
When you seeWhat to do
Boot fails with “PUBLIC_SALEOR_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. Install @misiki/saleor-connector, or remove the variable if you meant to run another backend. With more than one connector installed, set PUBLIC_CONNECTOR='@misiki/saleor-connector'.
Sign-in or cart works in dev but not when deployedAlmost always CORS: allow the deployed storefront’s origin on the Saleor API.

Before you rely on it

No connector has been exercised against a live production instance of its platform; each was written from the platform’s published source. The limits every backend shares and the errors every switch can meet are on the backends page.

Offer a sandbox or a correction

FAQ

Questions about Svelte Commerce on Saleor

Can I sell on Saleor with Svelte Commerce today?

Not yet. The coverage script counts cart, checkout and sign-in as not wired, CONNECTORS.md says the Saleor connector predates the current wiring pass, and its own guide says the card gateways throw “not implemented”.

Why does the guide describe a working checkout when the table says it is not wired?

The guide describes what the connector calls; the coverage script counts a service only when it reaches the connector’s own HTTP layer, and does not count cart, checkout or auth. CONNECTORS.md lists Saleor as a next candidate for the source-verification sweep that would settle it.

Which Saleor settings does Svelte Commerce need?

Email confirmation for registration turned off, isPhoneMandatory set to false, unpaid orders allowed in both the order settings and the channel settings, and the storefront’s origin allowed in CORS.

What goes in PUBLIC_SALEOR_API_URL?

The full GraphQL endpoint, such as https://your-store.saleor.cloud/graphql/ — not only the host. It is the one variable the Saleor connector needs.

Sources

SALEOR.md, read on ; CONNECTORS.md, read on ; the connector’s source at 87c3f2e. Where they disagree with this page, they are right. Saleor is a trademark of its owner, named only to describe compatibility; see trademarks.

Read the whole guide

Chat on WhatsApp