https://github.com/fleetbase/storefront-js
Fleetbase Storefront Javascript/ Node SDK
https://github.com/fleetbase/storefront-js
Last synced: about 1 year ago
JSON representation
Fleetbase Storefront Javascript/ Node SDK
- Host: GitHub
- URL: https://github.com/fleetbase/storefront-js
- Owner: fleetbase
- License: agpl-3.0
- Created: 2021-06-18T17:25:53.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T06:46:49.000Z (over 1 year ago)
- Last Synced: 2025-05-08T20:48:03.997Z (about 1 year ago)
- Language: JavaScript
- Size: 1.19 MB
- Stars: 3
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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](https://fleetbase.io/docs).
If you would like to make contributions to the Fleetbase Javascript SDK documentation source, here is a [guide](https://github.com/fleetbase/fleetbase-js/blob/master/CONTRIBUTING.md) in doing so.
## Quick Start for Browser
```js
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`