Skip to main content

Third-party Integrations in Next.js

Third-party apps add product reviews, marketing tools, forms and other services to your storefront. In a @weaverse/next theme you integrate them as Weaverse sections, so merchants can place and configure them in Studio. There are two approaches: render the app’s React components in a section, or call the app’s API from a section loader on the server. This is the Next.js counterpart of Third-party Integration. It assumes the client and server registries from the Quickstart.

Using the App’s Component Library

Many third-party applications provide React components that you can incorporate directly into your Weaverse sections:
  1. Install the Library
  2. Create the Schema
  3. Create the Section Component Sections render inside WeaverseNextRenderer, a Client Component, so the section module is 'use client':
    If the app requires a private API key or token, keep it in a server environment variable and call the app’s API from a server loader, as shown below. Only publishable, browser-safe identifiers belong in Studio settings.
  4. Register the Section Add the section to the client registry, and its schema to the server registry:

Querying App Data from App’s API

For third-party services that offer a REST or GraphQL API, fetch the data in a section loader. Loaders run on the server, so the API key never reaches the browser:
  1. Store API Credentials Securely
  2. Write the Loader Keep the loader in its own file so only the server registry imports it:
  3. Create the Schema
  4. Render the Loader Data
  5. Register the Section and Its Loader Add the component to the client registry, and the schema with its loader to the server registry:
    Per-item revalidation (shouldRevalidate) needs the route handler from Studio Integration.

Further Reading

Last modified on October 20, 2026