Svelte Commerce × Shuup

Svelte Commerce on Shuup

Solid core coverage for a smaller API: cart, checkout and sign-in are wired against Shuup’s REST API. Coupons, reviews, CMS pages, countries, states and wishlist are the recorded gaps.

What works on Shuup today

Cart, checkout and sign-in are wired; coupons, reviews, CMS pages, countries, states and wishlist are not.

Cart

Wired: issues a real request to Shuup.

Checkout

Wired: issues a real request to Shuup.

Sign-in (auth)

Wired: issues a real request to Shuup.

Known gaps: coupon, review, page, country, state, wishlist

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

What the connector calls on Shuup

The connector calls Shuup’s Django REST Framework API under /api/shuup/, with the JWT views at /api/api-token-auth/ and /api/api-token-refresh/, an API that its source says exists only in Shuup 1.9.x and earlier.

A shopper signs in through POST /api/api-token-auth/, and the JWT that comes back in the body is sent as Authorization: JWT <token>, kept in localStorage and a cookie under access_token, and re-issued once through POST /api/api-token-refresh/ when a call answers 401; HTTP Basic from the key and secret is used only when no token is set.

Requests the @misiki/shuup-connector source makes, by storefront service
ServiceWhat it requests
productGET /api/shuup/front/shop_products/ with shop, ordering, limit and offset, GET /api/shuup/front/shop_products/{id}/ for one product and GET /api/shuup/front/shop_products/best_selling/ for trending
categoryGET /api/shuup/category/ with identifier and status=1 to turn a handle into a numeric id, and GET /api/shuup/category/{id}/
searchGET /api/shuup/front/shop_products/ with categories, ordering and paging; a free-text query returns an empty result instead of a request
cartPOST /api/shuup/basket/new/ (with shop when a store id is set), GET /api/shuup/basket/{uuid}/, and POST to add/, update_quantity/, remove/ and clear/ under that basket
checkoutPOST /api/shuup/basket/{uuid}/set_shipping_address/, set_billing_address/ and set_shipping_method/, then POST /api/shuup/basket/{uuid}/create_order/
payment-methodGET /api/shuup/basket/{uuid}/, reading its available_payment_methods
orderGET /api/shuup/front/orders/ (filtered by identifier) and GET /api/shuup/front/orders/{id}/
addressGET and PATCH /api/shuup/front/user/me/, which carry the contact’s default billing and shipping addresses

Shuup rules the connector follows

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

Quick start

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

Clone it, choose the connector, point it at Shuup

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

# 3 — point it at your Shuup shop
echo PUBLIC_SHUUP_API_URL=https://your-store.example.com >> .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 Shuup
VariableRequiredWhat it does
PUBLIC_SHUUP_API_URLYesYour Shuup shop’s URL. Boot fails, naming this variable, if it is missing.
PUBLIC_SHUUP_ACCESS_TOKENNoA JWT, sent as Authorization: JWT <token> — Shuup accepts neither Token nor Bearer.
PUBLIC_SHUUP_API_KEYNoHTTP Basic username, used when no token is set; meant for server-to-server calls. See the limitations.
PUBLIC_SHUUP_API_SECRETNoHTTP Basic password, with the username above.
PUBLIC_CONNECTORNoOnly when more than one connector is installed: @misiki/shuup-connector names the one this build runs on.

init.ts hands the connector every PUBLIC_SHUUP_* variable that is set, camel-cased. The guide also lists PUBLIC_SHUUP_ACCESS_KEY, PUBLIC_SHUUP_STORE_ID and PUBLIC_SHUUP_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.

How the integration works

Shuup’s REST API accepts HTTP Basic, session and JWT authentication. The connector sends a JWT as Authorization: JWT <token> — the header prefix Shuup’s JWT library expects — and falls back to HTTP Basic when it has a username and password instead.

Limitations on Shuup

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 Shuup

Can I run a Shuup shop on Svelte Commerce today?

Cart, checkout and sign-in are wired; coupons, reviews, CMS pages, countries, states and wishlist are not. Like every connector, it has not been run against a live production Shuup shop.

How do I switch Svelte Commerce to Shuup?

Remove the connectors the storefront ships with, install @misiki/shuup-connector, set PUBLIC_SHUUP_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 does the connector authenticate with Shuup?

With a JWT, sent as Authorization: JWT <token>. Shuup does not install token authentication, so Token and Bearer headers are both refused. HTTP Basic is the fallback, meant for server-to-server calls.

Sources

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

Read the whole guide

Chat on WhatsApp