> ## 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

# Weaverse SDKs

> Weaverse SDKs bundle essential packages, streamlining the development and management of Weaverse themes for Shopify Hydrogen storefronts on React Router and Next.js.

The Weaverse SDK is organized into multiple packages, each serving a specific role in the development of Weaverse
themes for Shopify Hydrogen storefronts on React Router and the Next.js App Router. These packages provide the necessary tools and functionalities for an efficient and streamlined
development process.

## Package Overview

### `@weaverse/core`

This foundational package contains the core logic of Weaverse and Weaverse Items, focusing on essential operations and
data handling within the Weaverse ecosystem.

**Key Features:**

* Data model definitions for Weaverse components
* Core rendering logic
* State management utilities
* Type definitions shared across the ecosystem

**Installation:**

```bash theme={null}
npm install @weaverse/core
```

### `@weaverse/react`

Specializing in the user interface, this package provides React bindings for Weaverse, managing the rendering of Weaverse Items as React components and ensuring proper display and interaction within themes.

**Key Features:**

* React component rendering system for Weaverse items
* Context providers for Weaverse and item states
* Custom hooks for accessing Weaverse data and item instances
* Utility functions for CSS generation and class name handling

**Installation:**

```bash theme={null}
npm install @weaverse/react
```

**Core Components:**

* `WeaverseRoot`: The main component that renders your Weaverse content tree
* `WeaverseContextProvider`: Provides the Weaverse context to all child components
* `ItemComponent`: Renders individual Weaverse items based on their type and properties

**Essential Hooks:**

* `useWeaverse()`: Access the Weaverse instance from any component
* `useItemInstance(id?)`: Get a specific item instance by ID or the current item
* `useParentInstance()`: Get the parent item of the current component
* `useChildInstances(id?)`: Get all child instances of an item

**Basic Usage:**

```jsx theme={null}
import { registerElement, Weaverse } from '@weaverse/core';
import { WeaverseRoot } from '@weaverse/react';

// Initialize Weaverse
const weaverse = new Weaverse({
  projectId: 'your-project-id',
  data: yourWeaverseData
});

// Register your components.
// Registration is static — the registry is shared across every Weaverse
// instance. Use the exported `registerElement`, or `Weaverse.registerElement`.
registerElement({
  type: 'Button',
  Component: ButtonComponent,
  schema: {
    title: 'Button',
    type: 'Button',
    settings: [
      {
        group: 'Content',
        inputs: [
          // Input configurations
        ]
      }
    ]
  }
});

// Render the Weaverse content
function App() {
  return (
    <WeaverseRoot context={weaverse} />
  );
}
```

> [!NOTE]
>
> `registerElement` keys the registry by `type` and ignores a re-registration of
> a type that already exists, so register each element type once.

### `@weaverse/hydrogen`

Tailored for theme development, this package carries the logic required to build a Hydrogen Theme and facilitate its
integration with Weaverse Studio's customization features.

**Key Features:**

* Shopify Hydrogen integration
* Theme customization components
* Studio preview capabilities
* Hydrogen-specific renderers and utilities
* Entry points: themes import from `@weaverse/hydrogen/react-router`; `@weaverse/hydrogen/react` has the framework-free hooks

**Installation:**

```bash theme={null}
npm install @weaverse/hydrogen
```

**Basic Usage:**

```tsx theme={null}
// app/weaverse/index.tsx
import { WeaverseHydrogenRoot } from '@weaverse/hydrogen/react-router';
import { GenericError } from '~/components/root/generic-error';
import { components } from './components';

export function WeaverseContent() {
  return (
    <WeaverseHydrogenRoot
      components={components}
      errorComponent={GenericError}
    />
  );
}
```

`WeaverseHydrogenRoot` takes no children — it renders the Weaverse page resolved
for the current React Router route. Its props are:

| Prop | Type | Required | Description |
| - | - | - | - |
| `components` | `WeaverseComponent[]` | Yes | Theme components available to the page renderer |
| `data` | `WeaverseLoaderData \| Promise<WeaverseLoaderData \| null> \| null` | No | Explicit `weaverseData` payload that bypasses automatic route-scoped resolution. Pass `null` to suppress rendering |
| `errorComponent` | `React.FC<{ error: Error \| unknown }>` | No | Component rendered when page data cannot be resolved |

### `@weaverse/hydrogen/next`

The integration for Next.js App Router storefronts, shipped as entry points of `@weaverse/hydrogen` (`@weaverse/hydrogen/next` and `@weaverse/hydrogen/next/server`). It renders Weaverse pages, runs section loaders on the server, connects to Weaverse Studio, and refreshes loader-backed edits without React Router.

**Key Features:**

* Request-scoped server client (`createWeaverseNextServerClient` from `@weaverse/hydrogen/next/server`) for pages, theme settings, and custom pages
* `WeaverseNextRenderer`, `WeaverseNextProvider`, and a root `WeaverseNextRootProvider` for layout-level theme settings
* Studio bridge, per-item loader revalidation route handler, and Next `Metadata` helpers
* Markets, Translation Manager, and theme route support
* The Weaverse hooks (`useWeaverse`, `useItemInstance`, `useThemeSettings` and others) and `createSchema`

**Installation:**

```bash theme={null}
npm install @weaverse/hydrogen
```

`@weaverse/next` is deprecated; don't install it.

**Usage:** Start from the [Next.js quickstart](https://weaverse.io/docs/nextjs/quickstart.md), or the [Forward starter theme](https://weaverse.io/docs/hydrogen-themes/forward.md).

### `@weaverse/cli`

The command-line scaffolding tool for creating a Weaverse Hydrogen project from a supported template.

**Key Features:**

* Project scaffolding with templates
* Non-interactive project configuration through CLI flags
* Dependency installation and optional development-server startup

**Usage:**

```bash theme={null}
npx @weaverse/cli@latest create --template=pilot --project-id=YOUR_PROJECT_ID
```

### `@weaverse/biome`

A package that provides standardized [Biome](https://biomejs.dev/) configuration for Weaverse projects, ensuring consistent code formatting and linting across all Weaverse-related codebases.

**Key Features:**

* Preconfigured Biome settings optimized for Weaverse development
* Consistent code style enforcement
* Standardized linting rules with appropriate severity levels
* Compatible with React and TypeScript projects

**Installation:**

```bash theme={null}
npm install @weaverse/biome --save-dev
```

**Usage:**
In your project's root directory, create or update your `biome.json` file to extend the Weaverse configuration:

```json theme={null}
{
  "extends": ["./node_modules/@weaverse/biome/biome.json"],
  // Add any project-specific overrides here
}
```

**Key Configuration Details:**

The Weaverse Biome configuration includes:

* **JavaScript/TypeScript formatting:**
  * Uses single quotes
  * Employs spaces for indentation
  * Semicolons only as needed

* **Linting rules with sensible defaults:**
  * Accessibility (a11y) checks
  * React-specific best practices
  * Security protections
  * Code complexity guidance

This configuration helps maintain code quality and consistency across Weaverse projects while providing flexibility for project-specific needs.

## Package Compatibility

The Weaverse SDK packages are designed to work together seamlessly, but each can also be used independently based on your project needs:

| Package | Compatible With | Node.js | Runtime Dependencies |
| - | - | - | - |
| `@weaverse/core` | Any JavaScript project | `>=18` | None |
| `@weaverse/react` | React applications | `>=18` | `@weaverse/core`, `react` `>=19`, `react-dom` `>=19`, `clsx` |
| `@weaverse/hydrogen` | Shopify Hydrogen storefronts on React Router or the Next.js App Router | `>=20` | `@weaverse/react`, `@weaverse/schema`, `react`/`react-dom` `>=19`, `react-router` `^7`, `react-error-boundary` `^6` (peer: `@shopify/hydrogen` `>=2026.10.0`; optional peer: `next` `>=14`) |
| `@weaverse/schema` | Any JavaScript/TypeScript project | - | `zod` `^4` |
| `@weaverse/cli` | Node.js environment | `>=18` | None (run via `npx`) |
| `@weaverse/biome` | Any JavaScript/TypeScript project | - | None (peer: `@biomejs/biome`) |

## System Requirements

Requirements differ per package — check the table above for the exact package you
install. For the `@weaverse/hydrogen` package:

* **Node.js**: v20.0.0 or higher
* **React / React DOM**: v19.0.0 or higher
* **React Router**: v7 (not React Router DOM)
* **Shopify Hydrogen**: 2026.10 or higher (`@weaverse/hydrogen` 6). Classic Hydrogen 2026.4 and earlier stays on `@weaverse/hydrogen` 5.x; see the [v6 migration guide](https://weaverse.io/docs/migration-advanced/v6-migration.md)
* **npm**: v7.0.0 or higher (or equivalent package manager)

> [!NOTE]
>
> A generated theme may require a newer Node.js version than the SDK package.
> The current Pilot template declares Node.js `^22.18.0 || ^24.11.0`.

## Getting Started

> [!NOTE]
>
> Building on Next.js? Follow the [Next.js quickstart](https://weaverse.io/docs/nextjs/quickstart.md) instead.

For new Weaverse Hydrogen projects, the easiest way to get started is using the CLI:

```bash theme={null}
# Create a new project
npx @weaverse/cli@latest create --template=pilot --project-id=YOUR_PROJECT_ID --project-name=my-store

# Navigate to project directory
cd my-store

# Start development server
npm run dev
```

For existing projects, you can install the required packages individually and integrate them according to your needs.

## Open Source Status

The Weaverse team is actively working on improving these packages and expanding their capabilities. For the latest updates on availability and open source status, please check the [official Weaverse GitHub repository](https://github.com/Weaverse/weaverse).

## Additional Resources

* [Weaverse Documentation](https://weaverse.io/docs/index.md)
* [API Reference](https://weaverse.io/docs/api-reference/introduction.md)
* [Example Components](https://weaverse.io/docs/resources/example-components.md)
* [Community Forum](https://github.com/orgs/Weaverse/discussions)


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