> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# How Weaverse Works

> Understand the architecture and workflow of Weaverse's visual page builder integrated with Shopify Hydrogen.

# How Weaverse Works

Weaverse is a visual page builder for Shopify Hydrogen and other supported Shopify headless storefronts. Developers set up the storefront and its Weaverse integration; merchants then edit the content and layouts exposed by that integration in Weaverse Studio.

> [!WARNING]
>
> **Headless storefronts only, not Liquid themes.** Weaverse does not build or edit Shopify Online Store Liquid themes. Installing the app does not convert an existing Liquid theme into a Hydrogen storefront or make that theme editable in Weaverse Studio.

## Supported Storefronts

* **Shopify Hydrogen:** a Hydrogen storefront with the Weaverse integration, such as a project based on Pilot.
* **Next.js App Router:** a Shopify headless storefront using the supported `@weaverse/hydrogen/next` integration. See the [Next.js integration guide](https://weaverse.io/docs/nextjs/overview.md).

A Shopify store is still required for commerce data. The storefront being edited must run the relevant Weaverse integration. A Shopify store with only a Liquid theme is not a supported editing environment.

## Shopify Store Domain vs. Studio Preview URL

These addresses serve different purposes:

* **Shopify store domain:** `your-store.myshopify.com` identifies the Shopify store used for commerce data. It is not the headless application's preview address. The storefront served at this address normally belongs to Shopify's Liquid-based Online Store.
* **Studio preview URL:** the address of your running, Weaverse-integrated headless application. For the local Hydrogen quickstart, this is `http://localhost:3456`. For a hosted setup, use the actual deployed application's URL.

The headless storefront can be connected to the same Shopify store while running at a different URL. Pointing Studio at a Liquid storefront does not add the Weaverse integration to it.

## What the Shopify App Does

The Shopify app connects your store to the Weaverse project workflow. Creating a project and installing the app are not substitutes for setting up a compatible headless storefront. Weaverse Studio edits the registered components and content in that storefront, not the Liquid theme under **Online Store > Themes**.

## Set Up and Verify Your Headless Storefront

1. **Use a supported storefront.** Follow the [Hydrogen quickstart](https://weaverse.io/docs/intro/quickstart.md) to set up a Weaverse-integrated storefront, or connect an existing storefront with the appropriate Weaverse integration. A store using only a Liquid theme is not enough.
2. **Confirm the headless application loads.** Open its preview URL directly. If testing on another machine, use a reachable hosted preview; `localhost` refers to the machine running the browser.
3. **Connect Studio to that application.** Open the corresponding Weaverse project. If Studio shows **Preview Connection Lost**, use **Manage previews** to check that the selected URL belongs to the running headless application, not the store's Liquid storefront.
4. **Verify visual editing.** Open a page containing Weaverse sections, select a section, change an available content setting, and confirm the change appears in Studio's preview. Use the project's normal save and publish workflow to verify the result on that headless storefront.
5. **Check the correct output.** The expected result is on the connected headless storefront. The store's separate Liquid theme is not the output of this workflow.

**If the preview still fails:** an incorrect storefront URL is one possible cause, not the only one. A stopped application, an incomplete integration, or embedding restrictions can also prevent Studio from connecting. Follow [Preview Connection Errors](https://weaverse.io/docs/troubleshooting/preview-errors.md) rather than treating every connection error as proof of a Liquid-theme setup.

> [!NOTE]
>
> This page uses the React Router adapter, `@weaverse/hydrogen`, in its examples. Weaverse also supports Hydrogen storefronts on the Next.js App Router through `@weaverse/hydrogen/next`: the Studio workflow and component schemas are the same, while routes load pages through a request-scoped server client. See [how the Next.js integration differs](https://weaverse.io/docs/nextjs/overview.md).

## Architecture Overview

```mermaid theme={null}
graph LR
    A[Weaverse Studio<br/>Visual Editor] <--> B[Your Hydrogen<br/>Application]
    B <--> C[Shopify APIs<br/>Products, etc]
    
    style A fill:#246aff,stroke:#1e40af,stroke-width:2px,color:#fff
    style B fill:#599aff,stroke:#246aff,stroke-width:2px,color:#fff
    style C fill:#1e40af,stroke:#0f2d6f,stroke-width:2px,color:#fff
```

## The Weaverse Workflow

### 1. Developer Experience

**Code Components Once**

```tsx theme={null}
// app/sections/product-card/index.tsx
// You write React components with schemas
import { createSchema, type WeaverseComponentProps } from '@weaverse/hydrogen/react-router'

interface ProductCardProps extends WeaverseComponentProps {
  title: string
  price: string
}

function ProductCard({ ref, title, price, ...rest }: ProductCardProps) {
  return <div ref={ref} {...rest}>{title} - {price}</div>
}

export default ProductCard

export const schema = createSchema({
  type: 'product-card',
  title: 'Product Card',
  settings: [/* configuration */],
})
```

**Register Components**

Each component module is imported as a namespace (so Weaverse can read both the
default export and its `schema`) and added to the `components` array in
`app/weaverse/components.ts`:

```ts theme={null}
// app/weaverse/components.ts
import type { WeaverseComponent } from '@weaverse/hydrogen/react-router'
import * as ProductCard from '~/sections/product-card'

export const components: WeaverseComponent[] = [ProductCard]
```

### 2. Merchant Experience

**Visual Editing**

* Merchants drag components onto pages
* Real-time preview across all devices
* Intuitive settings panels for customization
* No code required

**Content Management**

* Create and manage pages visually
* Organize content with sections and components
* Preview changes before publishing

### 3. Runtime Performance

**No Page-Builder Runtime for Shoppers**

* Pages are server-rendered by Hydrogen on each request, using the page data loaded from Weaverse
* The Studio editing bridge only loads in design mode, not on the live storefront
* Only your component logic ships to browsers

**Optimized Builds**

* Automatic image optimization
* Code splitting by route
* Server-side rendering with Hydrogen

## Key Concepts

### Components vs Sections

**Components** are reusable UI elements:

* Buttons, cards, forms
* Configured through props
* Can be used multiple times per page

**Sections** are page-level building blocks:

* Headers, hero areas, footers
* Container multiple components
* Define page structure

### Schema-Driven Configuration

Every Weaverse component includes a schema that defines:

```typescript theme={null}
import { createSchema } from '@weaverse/hydrogen/react-router'

export const schema = createSchema({
  type: 'unique-component-name',
  title: 'Human-readable Title',
  settings: [
    {
      group: 'Content',
      inputs: [
        {
          type: 'text',
          name: 'heading',
          label: 'Heading Text',
          defaultValue: 'Hello World'
        }
      ]
    }
  ]
})
```

This schema automatically generates:

* Visual editor controls
* Validation rules
* Default values

### Data Flow

1. **Build Time**: Schemas define available components
2. **Edit Time**: Merchants configure component instances
3. **Request Time**: Hydrogen loads the page data from Weaverse and server-renders the HTML
4. **Hydration**: Interactive components become functional

## Integration with Hydrogen

Weaverse leverages Hydrogen's architecture:

* **React Router v7**: Route modules with loaders and type-safe route config
* **Streaming SSR**: Fast initial page loads with deferred non-critical data
* **Shopify APIs**: Native product and cart integration
* **Performance**: Optimized for Core Web Vitals

## Development Modes

### Local Development

* Hot reload for instant feedback
* Weaverse Studio runs alongside your app
* Real-time component updates

### Production

* Components are pre-built and optimized
* Merchants edit through hosted Weaverse Studio
* Changes deploy through your CI/CD pipeline

## Benefits

**For Developers:**

* Full control over component logic
* Modern React development experience
* No vendor lock-in
* Standard deployment workflows

**For Merchants:**

* Visual page building
* No technical knowledge required
* Real-time preview
* Mobile-responsive editing

**For Customers:**

* Fast loading pages
* Mobile-optimized experiences
* Consistent brand presentation
* Accessible by default

## Next Steps

* Learn about [Project Structure](https://weaverse.io/docs/intro/project-structure.md)
* Start building with the [Development Guide](https://weaverse.io/docs/development-guide/index)
* Explore the [API Reference](https://weaverse.io/docs/api-reference/introduction.md) for advanced usage


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.