How to get custom components via API in my next app?

Hi @rinkal, Welcome to Builder.io Forum!

Yes, it is expected if you are using our HTML API then custom components are not supported through the API. There is however a workaround with web components that lets you add custom components to your pages.

Registering Web Components for Use in Builder’s Visual Editor

The way custom component rendering works is that any component will need to be registered and imported in the same context where the SDK is rendering the content.

Our HTML API will return what we render on our servers, meaning that we will not have a user’s custom components available within the same context.

There are ways for you to create custom components within Builder that you could access from the HTML API. For example, you could create a symbol with any child elements, classes, CSS and JS you need and then use the HTML API to access that. Or similarly, that symbol placed on a page will be accessible as well.

Let us know if you face any issues while achieving this!