Svelte Commerce × EverShop
Svelte Commerce on EverShop
Solid core coverage: cart, checkout and sign-in are wired against EverShop’s API. EverShop is single-store, single-vendor and single-currency, and the recorded gaps are reviews, wishlist and vendors.
- 25/43 services wired
- @misiki/evershop-connector 0.4.0
- Cart wired
- Checkout wired
- Sign-in (auth) wired
What works on EverShop today
Cart, checkout and sign-in are wired; reviews, wishlist and vendors are not.
Cart
Wired: issues a real request to EverShop.
Checkout
Wired: issues a real request to EverShop.
Sign-in (auth)
Wired: issues a real request to EverShop.
Known gaps: review, wishlist, vendor
25 of 43 services wired, read from CONNECTORS.md on ; npm may carry a newer patch. How coverage is measured.
What the connector calls on EverShop
The connector calls EverShop’s API under /api, reading everything through the storefront GraphQL endpoint at /api/graphql and writing through REST routes on the same prefix, because EverShop’s REST surface is write-only.
The shopper signs in with POST /api/customer/tokens, and the returned access token is held in the connector’s credentials and sent as Authorization: Bearer; a guest cart rides on EverShop’s sid session cookie, which the connector captures from Set-Cookie and replays, with the cartId kept in a cookie as a fallback.
| Service | What it requests |
|---|---|
product | GraphQL products(filters: [FilterInput]) for lists, product(id: ID) for one product and featuredProducts(limit: Int), all posted to /api/graphql |
category | GraphQL categories(filters: [...]), with parent eq null for the root categories, and category(id: Int) { products(filters: [...]) } for a category’s products |
search | GraphQL products(filters: [...]) with the keyword, cat, min_price and max_price filter keys |
cart | POST /api/carts to create a cart, POST /api/cart/{cart_id}/items, PATCH and DELETE /api/cart/{cart_id}/items/{item_id}, then GraphQL cart(id:) or myCart to read the cart back |
checkout | POST /api/carts/{cart_id}/paymentMethods with method_code, then POST /api/orders with cart_id; Stripe adds POST /api/stripe/paymentIntents |
order | GraphQL order(uuid:) for one order and currentCustomer { orders } for the shopper’s history |
auth | POST /api/customer/tokens to sign in, POST /api/customers to register, PATCH /api/customers/me, POST /api/customers/reset-password and GraphQL currentCustomer |
address | GraphQL currentCustomer for the address book, POST /api/customers/me/addresses, PATCH and DELETE /api/customers/me/addresses/{id} |
EverShop rules the connector follows
- Cart routes are split between a plural and a singular prefix: the cart is created at
/api/carts, but its line items live under/api/cart/{cart_id}/items. - Line items are keyed by SKU rather than product ID, so when the storefront passes a numeric product ID the connector first looks up its
skuthrough GraphQLproduct(id:). PATCHon a line item takes a quantity plusaction: increaseordecrease, not an absolute quantity, so the connector reads the cart and sends the difference.- Only registered
productsfilter keys are sent, because EverShop ignores an unknown key and returns the whole catalogue; sorting maps to theobandodkeys, which know onlyprice,name,qtyandstatus. - GraphQL replies with HTTP 200 even when a query fails, so the connector checks
errorsin the body; access tokens are short-lived, and a 401 triggers one refresh throughPOST /api/customer/token/refresh, never on the sign-in routes, which allow 8 requests per 15 minutes.
Read from the source of misiki-in/evershop-connector at commit 89eee6a of . Where the code has changed since, the code is right.
Quick start
From nothing to a Svelte Commerce storefront reading EverShop. You need Node.js and a EverShop to point it at; the storefront holds no data of its own.
Clone it, choose the connector, point it at EverShop
# 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/evershop-connector
# 3 — point it at your EverShop store
echo PUBLIC_EVERSHOP_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
| Variable | Required | What it does |
|---|---|---|
PUBLIC_EVERSHOP_API_URL | Yes | Your EverShop store’s URL. Boot fails, naming this variable, if it is missing. |
PUBLIC_EVERSHOP_ACCESS_TOKEN | No | Sent as a bearer token when set. |
PUBLIC_CONNECTOR | No | Only when more than one connector is installed: @misiki/evershop-connector names the one this build runs on. |
init.ts hands the connector every PUBLIC_EVERSHOP_* variable that is set, camel-cased. The guide also lists PUBLIC_EVERSHOP_STORE_ID and PUBLIC_EVERSHOP_CHANNEL_ID, but EverShop is single-store, single-vendor and single-currency, so the connector leaves them unused; PUBLIC_EVERSHOP_API_KEY, PUBLIC_EVERSHOP_API_SECRET and PUBLIC_EVERSHOP_ACCESS_KEY are not read either.
Every variable here begins PUBLIC_, and SvelteKit sends PUBLIC_ variables to the browser: treat each value you set as published.
How the integration works
EverShop is a single store with one vendor and one currency, so there is no store or channel to choose: the connector talks to the one store at the URL you give it. Its recurring gaps are the ones CONNECTORS.md sees across this group of platforms — wishlist, reviews and coupon lookup — where the authors could not find an endpoint and would rather ask than invent one.
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 correctionFAQ
Questions about Svelte Commerce on EverShop
Can I run an EverShop store on Svelte Commerce today?
Cart, checkout and sign-in are wired; reviews, wishlist and vendors are not. Like every connector, it has not been run against a live production EverShop store.
How do I switch Svelte Commerce to EverShop?
Remove the connectors the storefront ships with, install @misiki/evershop-connector, set PUBLIC_EVERSHOP_API_URL in .env and start the dev server. vite.config.ts resolves whichever connector is installed, so no file in the storefront changes.
Can EverShop serve several stores or currencies through Svelte Commerce?
No. EverShop is single-store, single-vendor and single-currency, so the store and channel variables the guide lists are left unused by the connector.
Sources
EVERSHOP.md, read on ; CONNECTORS.md, read on ; the connector’s source at 89eee6a. Where they disagree with this page, they are right. EverShop is a trademark of its owner, named only to describe compatibility; see trademarks.