Overview
This integration guide shows you how to how to update your existing project to:- install the ButterCMS package
- instantiate ButterCMS
- create components to fetch and display each of the three ButterCMS content types: Pages, Collections, and Blog Posts.
Starter project
Or, you can jump directly to the starter project below, which will allow you to clone, install, run, and deploy a fully working starter project that’s integrated with content already inside of your ButterCMS account.Nuxt Starter Project
Hit the ground running with a pre-configured Nuxt + ButterCMS setup.
Installation
- npm
- yarn
- pnpm
.env:
Initialize the client
Create a composable for the ButterCMS client:nuxt.config.ts:
For complete SDK documentation including all available methods and configuration options, see the JavaScript SDK Reference.
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
- Blog Post List
- Single Blog Post
Preview Mode
Enable content editors to preview draft content:SEO
Resources
Nuxt Starter
Pre-configured starter project
JavaScript SDK
Complete SDK reference
GitHub Repository
View source code
Content API
REST API documentation