@purple-dot/browser

0.0.28 • Public • Published

@purple-dot/browser

This package is a toolbox for connecting your headless ecommerce application to Purple Dot. It provides all the features necessary for your integration, including APIs, cart & checkout functionality, and interceptors.

Please read http://bit.ly/47JtIk0 to learn how to integrate Purple Dot into your headless Shopify storefront.

API

import { init } from '@purple-dot/browser';
import { ShopifyAJAXCart } from '@purple-dot/browser/shopify-ajax-cart';

init({
  apiKey: 'xxx',
  cartAdapter: new ShopifyAJAXCart(),
});

Purple Dot API

import * as api from '@purple-dot/browser/api';

await api.fetchProductsPreorderState('test-product');

await api.fetchVariantsPreorderState(12345);

Cart

import { cartHasPreorderItem } from '@purple-dot/browser/cart';

await cartHasPreorderItem();

Purple Dot Checkout

import * as checkout from '@purple-dot/browser/checkout';

await checkout.open();

Shopify AJAX Cart Interceptors

import * as interceptors from '@purple-dot/browser/shopify-ajax-interceptors';

interceptors.start();

Readme

Keywords

none

Package Sidebar

Install

npm i @purple-dot/browser

Weekly Downloads

34

Version

0.0.28

License

Apache-2.0

Unpacked Size

72.8 kB

Total Files

33

Last publish

Collaborators

  • suryarajendhran
  • jcs180
  • rtkaleta
  • alexstapleton
  • domk
  • andrew-rennie