Framework Integration · Astro

Fast Astro storefronts powered by Shoprivet APIs.

Keep your Astro pages near zero JavaScript for search engines and readers while pulling real products from Shoprivet and hydrating only the shopping cart interaction.

How do you add ecommerce to an Astro site?

Fetch GET /public/stores/{slug}/products in Astro component frontmatter to output pure server or static HTML, then embed widget.js or wire a lightweight client cart script to /public/stores/{slug}/carts.

Practical implementation

Three steps for Astro ecommerce

  1. 1

    Fetch products in .astro frontmatter

    Query GET /public/stores/:slug/products during SSR or build time so product names, descriptions, and prices render cleanly in initial HTML.

  2. 2

    Hydrate cart actions only where needed

    Use widget.js for zero-boilerplate cart drawers or attach small vanilla JS / Astro island handlers for custom Add to Cart buttons.

  3. 3

    Configure payment verification on return

    Use POST /public/stores/:slug/orders/:orderNumber/confirm on your order confirmation page.

Astro frontmatter catalog fetch

---
const res = await fetch("https://api.shoprivet.io/public/stores/downtown-shop/products");
const { products = [] } = res.ok ? await res.json() : { products: [] };
---

Requirements, pricing & limits

Astro static vs SSR guidance

Live pricing with SSR or widget.js

Static Astro builds snapshot catalog data at build time; use Astro SSR adapters or widget.js when stock and prices change frequently.

Zero backend boilerplate

Avoid running separate cart or payment verification servers.

All 5 online payment gateways

Accept Stripe, Paystack, Flutterwave, Razorpay, PayPal, and Cash on delivery.

OpenAPI & AI coding friendly

Reference /docs/openapi.json in Cursor when building custom Astro islands.

Direct answers

Frequently asked questions

Does Astro need a React or Vue island to use Shoprivet?
No. You can use Astro frontmatter with plain HTML/JS or drop in widget.js directly without shipping a UI framework runtime.
Can Astro sites still update prices without rebuilding?
Yes, if you deploy with an Astro SSR adapter or mount widget.js on your catalog page.
Where is the complete Astro code sample?
Follow /docs/guides/astro for a complete .astro page example.
Is there a free Shoprivet tier for side projects on Astro?
Yes. The Free tier is $0/month for 1 store, 25 products, and 50 orders/month.

Start free at $0/month

Launch with 0% Shoprivet platform fees.

Create a store in minutes, embed a catalog on your existing site, or call our public Storefront and /v1 APIs.

Create your free store