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
Create the project
.env with your project ID, and installs dependencies with Bun. If Bun is missing, it offers to install it (npm install -g bun); in a non-interactive run it stops with install instructions instead. Pass --no-install to skip installing.2
Add your Shopify keys
In Forward always runs against a real Shopify store, and refuses to start without a complete Shopify environment.
my-storefront/.env, set your store and its Storefront API keys from the Headless channel:.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.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:@weaverse/next components are Client Components that Server Components can render directly, and its server-safe exports (createSchema, generateDataFromSchema, the SEO helpers) work in server code. WeaverseRoot is a client module for a different reason: it imports the theme schema on the client, because a schema can hold functions that cannot cross from server to client. 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.