Was this page helpful?

Create Contentful App

Apps are single page JavaScript applications that can be rendered inside Contentful's user interface. Apps are managed within a Contentful organization through the Content Management API's AppDefinition and AppInstallation endpoints. To make the process of creating a new app simpler, the create-contentful-app CLI supports creating an app template, creating an AppDefinition, and gives instructions on how to install the app into a space environment.

This article explains how to create and deploy an app from scratch using create-contentful-app.

Getting started

Watch our overview video on how to use the create-contentful-app CLI

Prerequisites

In order to use this command line tool you'll need Node.Js version 8.10 or newer, and NPM version 5.6 or newer installed on your machine. You will also need a Contentful account with an organization management role. Organization management roles are owners, admins or developers.

Create a new app

To get started, initialize an app template:

npx @contentful/create-contentful-app init my-first-app

This step may take a while. When the command finishes it will have created a new directory called my-first-app.

Open your project folder and configure your app:

cd my-first-app
npx @contentful/create-contentful-app create-definition

Running the create-definition command will walk you through the process of configuring your app, and creating an AppDefinition. If necessary the command will also walk you through the process of authenticating with Contentful. The configuration created in this step can easily be changed later.

Local development

Once the configuration is complete, run the app:

npm start

This command starts the development server, and will walk you through installing your app into a Contentful space environment. The extension will automatically reload if you make changes to the code.

Note: As Contentful runs in an HTTPS environment, temporarily disable the security checks in the browser. For example, enable "Load unsafe scripts" in Chrome.

Programmatic app management

To manage an app programmatically, refer the Content Management SDKs.

Next steps

Not what you’re looking for? Try our FAQ.