Package Exports
- @techbase-mn/storefront
- @techbase-mn/storefront/dist/cjs/storefront.js
- @techbase-mn/storefront/dist/esm/storefront.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@techbase-mn/storefront) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Ecommerce companion SDK & API for Fleetbase, build custom shopping experiences for on-demand orders.
fleetbase.io | @fleetbase_io | Discord
Installation
With NPM
npm install @fleetbase/storefront
With Yarn
yarn add @fleetbase/storefront
Documentation
See the documentation webpage.
If you would like to make contributions to the Fleetbase Javascript SDK documentation source, here is a guide in doing so.
Quick Start for Browser
import Storefront, { Product } from "@fleetbase/storefront";
const storefront = new Storefront("Your Store Key");
// list products
storefront.products.findAll();
// create a product
const product = new Product({ name, description, price });
// retrieve cart & add item
storefront.cart.retrieve().then((cart) => {
cart.add("product_xyxyxyx", 1);
// empty cart
cart.empty();
});
// checkout
storefront.checkout.capture();Create a custom adapter
Storefront will eventually allow you to bring your own ecommerce adapter.
@todo