Made in Builder.io

Upcoming webinar with Figma: Design to Code in 80% Less Time

Announcing Visual Copilot - Figma to production in half the time

Builder.io logo
Talk to Us
Platform
Developers
Talk to Us

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

We recommend the latest API version, which is currently v3.

To leverage the latest Content API features, we recommend using the most recent version. Currently, the latest version is v3, which offers important advantages over previous versions.

Content API v3 benefits include:

  • Better, more scalable infrastructure: The content API is built on global scale infrastructure to ensure fast response times and high availability.
  • Ability to ship more features, faster: With v3, Builder can ship the latest features to customers without breaking fundamental flows. These features are only available in v3 and not in prior versions of the Content API.

To use the v3 Content APIs, upgrade your SDKs to the latest version with npm with the following:

npm update YOUR_SDK@latest

For example, if using the React SDK, the command would be:

npm update @builder.io/sdk-react@latest

SDK versions higher than those in the following table use the v3 Content APIs by default. Any prior SDK version uses v2 or below of the Content API.

Check the following table for information on which SDK versions support which Content API versions.

SDKSDK version and Content API support

React SDK (@builder.io/react)

  • 2.0.16 and below: Only supports v1.
  • >= 2.0.17 but < 3.0.0: Adds support for apiVersion property. Default API is v1.
  • 3.0.0: Default API version is v3.

React-Native, Vue, Svelte, SolidJS, Qwik and Beta React SDKs

  • 0.1.11 and below: Only supports v2.
  • 0.1.12: Adds support for apiVersion property. Default API is v2.
  • 0.2.0: default API version is v3.


  • Better support for localization (coming soon): The content API will provide improved support for localization, including querying based on localization features.
  • Support for multi-level nested references (coming soon): The content API will allow you to query, resolve, and return content that has nested references of other contents and symbols.

When making requests to Builder's Content API, be sure to use v3 in the path, as in /api/v3/content instead of v2:

- fetch('https://cdn.builder.io/api/v2/content/...')
+ fetch('https://cdn.builder.io/api/v3/content/...')

Do the same for the GraphQL API and HTML API; that is, replace v1 with v3:

- fetch('https://cdn.builder.io/api/v1/html/...')
+ fetch('https://cdn.builder.io/api/v3/html/...')
- fetch('https://cdn.builder.io/api/v1/graphql/...')
+ fetch('https://cdn.builder.io/api/v3/graphql/...')

If you encounter limitations with v3 when querying content, you have the option to fall back to v1 — or v2, depending on your SDK — for individual queries.

The React SDK supports v3 or v1 with the apiVersion property.

To use v1, update builder.apiVersion, which is typically in the same place where you call buidler.init() to initialize the React SDK:

import { builder } from "@builder.io/react";

builder.init('YOUR_BULDER_PUBLIC_API_KEY');
builder.apiVersion = "v1"; //this can be v1 or v3

Though we highly recommend using the latest Content API, you can toggle versions.

Using the apiVersion property, you can toggle the API version between v3 and v2, if needed, for the following SDKs:

  • React-Native
  • Qwik
  • SolidJS
  • Svelte
  • Vue

For example, to use v2, pass the apiVersion property in two places:

  1. The Content component that renders the Builder content
  2. The getContent() function that fetches the content

The following snippets provide an example:

<Content apiVersion="v2" />
// The name of this package import will depend on your SDK.
import { getContent } from "@builder.io/sdk-qwik";

getContent({ apiVersion: "v2" })

Versions 1 and 2 do not have the latest features and improvements available in v3, as v3 is the default and recommended version for content queries.

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Newsletter

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy