Integration Guide · HTML & Static Sites

Add a Shopping Cart to an HTML Website

Turn any static HTML page, landing page, or portfolio into an online store using Shoprivet widget attributes or vanilla browser fetch.

Target: Plain HTML / Vanilla JavaScript Integration: JavaScript Embed Widget (widget.js) or Public REST API OpenAPI 3.0 Spec

Prerequisites & Setup Checklist

  • Any HTML file or static site host
  • A Shoprivet store slug with active products
  • Sign up at shoprivet.io/app/signup, create a store, add products, and configure a payment gateway (or Cash on delivery).

Implementation Steps

1. Configure your catalog widget in the Shoprivet dashboard

In Dashboard -> Catalog Widgets, choose layout options such as max width, navigation bar, hosted cart link, or cart button inside the navigation header. Copy your generated snippet or configure data-shoprivet-* attributes directly.

2. Paste the container and async script into your HTML page

Place <div data-shoprivet="your-store-slug"></div> inside <main> where the catalog should appear, and load https://api.shoprivet.io/widget.js asynchronously.

3. Verify product browsing and checkout flow

Test adding products, switching variants, opening the cart drawer, and submitting an order across desktop and mobile viewports.

shop.html · Drop-in embed with configuration attributes
<section aria-label="Online Store">
  <div
    data-shoprivet="downtown-shop"
    data-shoprivet-max-width="1120px"
    data-shoprivet-navigation="true"
    data-shoprivet-cart-in-nav="true"
    data-shoprivet-hosted-cart="true"
  ></div>
  <script src="https://api.shoprivet.io/widget.js" async></script>
</section>

Payment Verification, Error Handling & Security

Ensure your server Content-Security-Policy (if configured) allows script-src https://api.shoprivet.io and connect-src https://api.shoprivet.io.

  • No API key is placed in your HTML source; widget.js interacts exclusively with public Storefront endpoints and guest cart sessions.
  • Order totals and digital download permissions are computed server-side by Shoprivet at checkout.

Deployment

Host anywhere: GitHub Pages, Cloudflare Pages, S3, Netlify, Nginx, or shared cPanel hosting.