Made in Builder

Made in Builder

×

Developers

Product

Use Cases

Pricing

Developers

Resources

Company

Get StartedLogin

Product

Features

Integrations

Talk to an Expert

Pricing

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

Server-side and Static Site Rendering with Builder

Builder supports Server-side rendering, that is SSR, and static site rendering, SSG, out-of-the-box for all components.

Prerequisites

To leverage SSR and SSG with Builder, you must be using a framework that supports these features. Note that Angular does not support SSR and SSG.

Fetching data before render with Next.js and Builder

If you have custom components that depend on external data sources and need that data server-side, such as a products API, use Builder's getAsyncProps utility to fetch any data needed server-side before render.

Tip: If you have React custom components that depend on external data sources and need that data server-side, such as a products API, use Builder's getAsyncProps() utility to fetch any data needed server-side before render.

The following Next.js example demonstrates using getAsyncProps() to fetch the data before rendering the page. The steps are as follows:

  1. Import getAsycnProps from @builder.io/utils.
  2. Use the function getStaticProps() to fetch data async with getAsyncProps. When the data arrives, getStaticProps() returns the content.

For more information on server-side data, see the getAsyncProps README.


Need Expert help?

Submit a project to our partners, BuildQuick, and be matched with a Builder expert.

Submit a project

Was this article helpful?