Skip to main content

Overview

This integration guide shows you how to how to update your existing project to:
  1. install the ButterCMS package
  2. instantiate ButterCMS
  3. create components to fetch and display each of the three ButterCMS content types: Pages, Collections, and Blog Posts.
In order for the snippets to work, you’ll need to setup your dashboard content schemas inside of ButterCMS first.

Installation

For environment variables, install react-native-config:

Initialize the client

Add to .env:
For complete SDK documentation including all available methods and configuration options, see the JavaScript SDK Reference.

Custom hooks

Pages

Collections

Dynamic components

Component Renderer

Example Component

Using in Pages

This uses a distinct page type (component_page) whose body is a Component Picker (Page Builder) field — an array of components — separate from the WYSIWYG landing_page in the Pages section (whose body is a string). A page’s body is one field type or the other, so the Page Builder example needs its own page type.

Blog

Caching

Resources

JavaScript SDK

Complete SDK reference

React Guide

React web integration

GitHub Repository

View source code

Content API

REST API documentation