Framework Integration · Next.js

Build an SEO-friendly Next.js store on Shoprivet APIs.

Render server-side Next.js product pages with zero extra commerce infrastructure. Read public catalogs in Server Components, run guest carts in browser state, and keep /v1 keys safely on the server.

Can I use Shoprivet with Next.js App Router?

Yes. Next.js Server Components can fetch unauthenticated GET /public/stores/{slug}/products endpoints for SSR/ISR product pages, while client components call /public/stores/{slug}/carts and Route Handlers can safely use server-only SHOPRIVET_API_KEY credentials.

Practical implementation

Clean Next.js integration architecture

  1. 1

    Fetch catalogs in Server Components

    Use fetch with Next.js revalidate caching against GET /public/stores/:slug/products so prices and metadata render in initial HTML.

  2. 2

    Run guest carts without exposing API keys

    Create guest carts via POST /public/stores/:slug/carts from the client, then check out with an idempotencyKey.

  3. 3

    Keep merchant /v1 keys strictly server-side

    Never prefix merchant API keys with NEXT_PUBLIC_. Keep SHOPRIVET_API_KEY in Route Handlers or Server Actions only.

Next.js Server Component fetch

const res = await fetch("https://api.shoprivet.io/public/stores/downtown-shop/products", { next: { revalidate: 60 } });
const { products } = await res.json();

Requirements, pricing & limits

Developer highlights for Next.js teams

OpenAPI 3.0.3 schema ready

Generate TypeScript types directly from https://shoprivet.io/docs/openapi.json.

Five global payment providers

Query /public/stores/:slug/payment-methods dynamically to render Stripe, Paystack, Flutterwave, Razorpay, PayPal, or COD options.

Digital & physical order fulfillment

Retrieve order status and paid digital file download URLs using the checkout orderAccessToken.

Rate limits and error handling

Public carts allow 60 req/min; /v1 endpoints scale from 60 to 1,000 req/min across Free, Premium, and Business plans.

Direct answers

Frequently asked questions

Should I put my Shoprivet API key in NEXT_PUBLIC_SHOPRIVET_API_KEY?
No. Never expose shoprivet_live_... keys in NEXT_PUBLIC_ variables. Use unauthenticated /public/stores/{slug} endpoints in client code and keep /v1 keys strictly in Server Components, Route Handlers, or Server Actions.
Do I need a Next.js database for carts or orders?
No. Shoprivet persists carts, stock reservations, discounts, orders, and payment verification in its managed backend.
Does Shoprivet offer a Next.js starter guide?
Yes. Follow the step-by-step Next.js Storefront Guide at /docs/guides/nextjs.
Are there Shoprivet transaction fees on headless Next.js stores?
No. Every plan carries 0% Shoprivet platform fees.

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