JS library to integrate Swish into a browser environment.
JavaScript library for integrating Swish on a Shopify web store (themes and headless stacks).
To load the Swish app, you can either activate the Swish embed through your theme editor or install it via NPM. We recommend using the app embed for most scenarios. For headless stacks, NPM is necessary.
Make sure to activate the Swish embed in the theme editor!
``html`
`ts
import { swishApp } from "/apps/wishlist/assets/browser/swish.js";
const swish = await swishApp({
proxy: {
baseUrl: "/apps/wishlist",
},
});
const { data } = await swish.api.items.list();
``
The Swish browser library requires a proxy service that operates on the same domain as the store. This service facilitates the loading of additional resources and ensures secure communication with the Swish API.
Please use the Node.js library to implement the app proxy.
For more information visit Swish DEV docs.