Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@builder.io/sdk-react-nextjs

Package Overview
Dependencies
Maintainers
21
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/sdk-react-nextjs

Builder.io RSC SDK for NextJS App Directory

latest
Source
npmnpm
Version
0.24.1
Version published
Weekly downloads
640
-51.48%
Maintainers
21
Weekly downloads
 
Created
Source

When should I use this SDK (please read carefully)

  • you should ONLY use this SDK if you are trying to register your RSCs (react server components) in Builder. That is its only advantage over our standard React SDKs.
  • our Gen1 and Gen2 React SDKs work perfectly well with all versions of Next.js. The only feature they do not support is registration of RSCs.
  • this SDK only works in the NextJS App Directory.

To allow registering RSCs, this SDK must make compromises. Most notably:

  • it does not support interactive Builder features within the rendered content (such as updating dynamic bindings, state, actions etc.). As of today, there are no workarounds around these limitations, due to how RSCs work. See the features grid for more information.
  • the visual editor experience is laggy, as it requires network roundtrips to the customer's servers for each edit. We are working on improving this.

this SDK is marked as "Beta" due to the missing features mentioned above. It is however actively maintained and developed alongside all other SDKs.

Builder.io React NextJS SDK (BETA)

This is the Builder NextJS SDK, @builder.io/sdk-react-nextjs. It is intended to be used only with NextJS's app directory, and has hard dependencies on NextJS-specific functionality that only works in the app directory.

Usage

When registering a custom component, you will need to add the isRSC: true option to the component. For example:

// CatFacts.tsx
async function CatFacts() {
  const catFacts = await fetch('https://cat-fact.herokuapp.com/facts').then(
    (x) => x.json()
  );
  return (
    <div>
      Here are some cat facts from an RSC:
      <ul>
        {catFacts.slice(3).map((fact) => (
          <li key={fact._id}>{fact.text}</li>
        ))}
      </ul>
    </div>
  );
}

export const CatFactsInfo = {
  name: 'CatFacts',
  component: CatFacts,
  // You must add the below option or the SDK will fail to render.
  isRSC: true,
};

And in your page.tsx, you can use the custom component like this:

// page.tsx
import {
  Content,
  fetchOneEntry,
  getBuilderSearchParams,
} from '@builder.io/sdk-react-nextjs';
import { CatFactsInfo } from './CatFacts';

export default async function Page(props) {
  const urlPath = '/' + (props.params?.slug?.join('/') || '');

  const content = await fetchOneEntry({
    model: 'page',
    apiKey,
    options: getBuilderSearchParams(props.searchParams),
    userAttributes: { urlPath },
  });

  return (
    <Content
      content={content}
      model="page"
      apiKey={apiKey}
      customComponents={[CatFactsInfo]}
    />
  );
}

For more usage information, look at the examples.

Mitosis

This SDK is generated by Mitosis. To see the Mitosis source-code, go here.

Feature Support

To check the status of the SDK, look at these tables.

Getting Started

npm install @builder.io/sdk-react-nextjs

Examples

FAQs

Package last updated on 17 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts