Next.js Quickstart
There are two ways to start:- Start from Forward, the Weaverse Next.js starter theme. Everything below is already wired.
- Add Weaverse to an existing Next.js app, step by step.
Option A: Start from Forward
Forward is an open-source Next.js storefront on@weaverse/next. It uses Bun as package manager and Node.js 22.18 or later.
1
Clone the theme
2
Configure the environment
Copy Forward always runs against a real Shopify store, and refuses to start without a complete Shopify environment.
.env.example to .env and fill in your store and project:.env.example documents every key, including the optional Customer Account ones.3
Run it
http://localhost:3333.4
Open it in Studio
Open
https://studio.weaverse.io/projects/YOUR_PROJECT_ID and set the preview URL to http://localhost:3333.Scaffolding Forward with
npx @weaverse/cli create is coming. Until then, clone the repository.Option B: Add Weaverse to an existing Next.js app
This path assumes an App Router app that already reads from your Shopify store, typically through the Hydrogen SDK (npx @shopify/hydrogen@latest setup). Forward is a complete example of that setup.
1. Install
2. Environment variables
3. Register components
A component is a schema plus a React component. Schemas are written exactly as for@weaverse/hydrogen; see Component schema and Input settings.
'use client' module. Section loaders run on the server, so they live in a server-only registry that carries the same schemas:
loader to a server entry to fetch data; see Data fetching.
Declare the theme schema once. It holds your theme settings, and later your markets and routes:
4. Create the server client helper
On React Router,@weaverse/hydrogen injects context.weaverse into every loader. In Next, your app creates the server client per request. A small helper plays that role:
5. Mount the root providers
Mount the Studio script connector and the root theme provider once, in the root layout:publicEnv is passed explicitly because a layout receives no search params; see Known limitations.
6. Render a page
WeaverseNextRenderer is a Client Component. Wrap it in one client boundary that rebuilds the request context from the payload, so Studio knows which route it is looking at:
7. Add the revalidation route
Studio posts here when a merchant changes a resource picker, to re-run only that section’s loader:8. Open it in Studio
Run your app, openhttps://studio.weaverse.io/projects/YOUR_PROJECT_ID, and set the preview URL to your dev server.
Next steps
Rendering pages
Product, collection, custom pages, metadata and sitemap.
Data fetching
Section loaders and caching.
Studio integration
How Studio connects and what it needs.
Deploy to Vercel
Ship your storefront.