Skip to main content

@weaverse/hydrogen/next API Reference

The Next.js adapter ships in @weaverse/hydrogen (install @weaverse/hydrogen) and has two entry points: Server code lives under @weaverse/hydrogen/next/server so a Client Component can import the root entry without pulling server-only fetch code into the browser bundle. The root entry is safe in Server Components: its components, hooks and runtime are Client Components (render them, don’t call them on the server), and its schema helpers run as ordinary server functions.
@weaverse/next is deprecated. Its root and /server entries exported more than @weaverse/hydrogen/next does: the page, root and commerce data hooks, the lower-level Studio runtime, loader and revalidation helpers, the ThemeText* aliases, and the server config and page URL helpers. Only the exports listed on this page are available.

@weaverse/hydrogen/next

Components and providers

Hooks

Studio

Translation

See Markets & translations.

SEO

Both are also exported from @weaverse/hydrogen/next/server. See Rendering pages.

Schema and errors

Types

@weaverse/hydrogen/next/server

Types: WeaverseNextServerClient, WeaverseNextServerClientConfig, WeaverseNextServerLoadPageInput, WeaverseNextThemeSettingsOptions, WeaverseNextThemeSettingsResponse, WeaverseNextConfigs, WeaverseNextBaseConfigs, WeaverseNextCacheConfig, WeaverseNextFetchOptions, WeaverseNextCustomPageEntry, WeaverseNextFetchCustomPagesOptions, WeaverseNextProjectId, WeaverseNextRevalidateHandler, WeaverseNextRevalidateHandlerConfig, the SEO types (WeaverseNextSeoInput, WeaverseNextSeoMetadata, WeaverseNextSeoPageContainer, NextOpenGraph, NextTwitter), plus the shared types above.

Server client config

Server client members

Config resolution

  • Project id: ?weaverseProjectId= → projectId function → projectId string → WEAVERSE_PROJECT_ID.
  • Studio host: trusted ?weaverseHost= (https://*.weaverse.io, https://*.weaverse.dev) → WEAVERSE_HOST → https://studio.weaverse.io.
  • API base: trusted request host → WEAVERSE_PUBLIC_API_BASE → non-production WEAVERSE_HOST → https://api.weaverse.io.
  • Public env: PUBLIC_STORE_DOMAIN, PUBLIC_STOREFRONT_API_TOKEN.
Last modified on November 11, 2026