Build E-Commerce with Open-Source Selldone — Fetch List of Products + Vue3 Sample

M. Pajuhaan
3 min readMay 13, 2024


In this article, I’ll guide you through fetching products from a shop using Selldone. Selldone offers a beautifully designed workspace equipped to handle millions of orders while providing the flexibility to craft a fully customized website. With Selldone, you can efficiently manage products, payments, and orders, all within a user-friendly environment. Whether you’re looking to streamline your operations or enhance your online presence, Selldone has the tools you need to succeed.

SDK Source:

Live Sample Code:

Add Package

npm install @selldone/sdk-storefront

# or

yarn add @selldone/sdk-storefront


Incorporate Meta Tags for Selldone Integration

To integrate your web application with the Selldone ecosystem effectively, it’s essential to embed specific meta tags within the <head> section of your HTML. These tags enable the Selldone SDK to establish a connection with the Selldone API, facilitating the retrieval of your shop's data.

<!-- 🏬 Specify the shop's name -->
<meta name="shop-name" content="toysworld">

<!-- 🎗 Set the app's prefix address, for example: /my-shop-path -->
<meta name="shop-prefix-address" content="">

<!-- 📰 Define a custom homepage for the shop -->
<meta name="custom-home" content="shop">

<!-- ―――――――――――――――― Start ❯ Business OS Configuration ―――――――――――――――― -->

<!-- 🪁 Service Origin -->
<meta content="" name="service-url">

<!-- 🎯 APIs -->
<meta content="" name="selldone-gapi">
<meta content="" name="selldone-xapi">
<meta content="" name="selldone-iframe">
<meta content="" name="selldone-capi">

<!-- 🌍 CDNs -->
<meta content="" name="selldone-cdn-images">
<meta content="" name="selldone-cdn-jsons">
<meta content="" name="selldone-cdn-videos">
<meta content="" name="selldone-cdn-temp-files">
<meta content="" name="selldone-cdn-ar">
<meta content="" name="selldone-cdn-id">
<meta content="true" name="storage-redirect">
<meta content="" name="storage-redirect-host">
<meta content="true" name="storage-redirect-thumbnails">

Storefront SDK — Global Initialize

// ━━━ Selldone Core (gapi,...) ━━━
import { SelldoneCore } from "@selldone/core-js";

// ━━━ Storefront SDK (xapi) ━━━
import {StorefrontSDK} from "@selldone/sdk-storefront";
StorefrontSDK.Setup(); // Set up the Shop SDK.

Fetch Products

* Handles the success response from the storefront API fetch call.
* Updates the internal state with the new data fetched.
* @param {Object} response - The response object from the API.
* @param {Array} response.products - Array of product objects.
* @param {number} - Total number of products.
* @param {Array} response.folders - Array of folder objects.
* @param {Object} response.parent - The parent category object.
const handleSuccessResponse = ({ products, total, folders, parent }) => {
this.products_count = total;
this.products = products;
this.folders = folders;

* Initiates a fetch operation for products with various filtering and sorting options.
* @param {string} dir - Category ID from which to fetch products.
* @param {boolean} offset - Flag to determine if more products should be loaded.
* @param {number} limit - Maximum number of products to fetch.
* @param {Object} options - Options for fetching products.
* @param {number} options.categories_count - Number of categories to fetch.
* @param {boolean} options.with_parent - Include the parent category in the response.
* @param {boolean} options.with_page - Include linked custom page of the current category.
* @param {string|null} options.sort - Sorting criteria for the products.
* @param {boolean} options.available - Whether to only include available items.
* @param {string|null} - Search term to filter products.
* @param {string|null} options.search_type - Type of search filtering.
* @param {Array|null} options.dirs - Array of category IDs to filter the items.
* @param {Object|null} options.filter - Additional filters.
* @param {boolean} options.products_only - Return only products.
* @param {boolean} options.categories_only - Return only categories.
* @param {boolean} options.with_total - Include the total count of products.
* @param {Object|null} options.bounds - Geographic constraints for product search.
* @param {Array|null} options.tags - Filter by product tags.
* @param {number|null} options.vendor_id - Filter products by vendor ID.
* @param {boolean} options.surrounded - Determines the inclusion of selected categories.
.optimize(600) // Cache products for 600 seconds
.fetchProducts(null, 0, 10, {
categories_count: 10,
with_parent: true,
with_page: true,
sort: null,
available: false,
search: null,
search_type: null,
dirs: null,
filter: null,
products_only: false,
categories_only: false,
with_total: true,
bounds: null,
tags: null,
vendor_id: null,
surrounded: false,
.catch((error) => {
// log error
.finally(() => {
// ...

Storefront SDK + Vue 3 + TypeScript + Vite

Here’s a basic implementation of the SDK using the Vue3 framework.



M. Pajuhaan

Design is my passion and expertise. I am an engineer, inventor and entrepreneur. Currently my focus is on designing businesses based on AI and robotics.