This repository shows how to use @purple-dot/browser to build a headless pre-order integration with Purple Dot.
-
main.tsx: entrypoint where Purple Dot is configured. -
AddToCardButton.tsx: uses the availability API to determine if an item is on pre-order or out of stock. -
PreOrderButton.tsx: adds a pre-order item to the cart and then shows the checkout modal. -
PreOrderExpressButton.tsx: simultaneously adds an item to the cart and shows the checkout modal.
pnpm install
pnpm dev
Navigate to http://localhost:5173 to view the demo.
Please see the @purple-dot/browser package and related documentation to learn more.