Start building an app for Contentful with this hello-world-react boilerplate. It comes with React, the App SDK, our design system Forma 36, and all the code you need to run a basic app. It will render a simple "Hello World!" in the app configuration screen:
Keep in mind that using React is not required to build a Contentful app.
Install it and run:
npm install
npm start
# or
yarn
yarn start
To test, you can create an app definition in your Contentful organization settings pointing to http://localhost:1234
and registering the app-config
location:
Keep in mind that when you serve an app locally over
http
, you will get a warning about insecure content. You can ignore this during development.
.
├── README.md
├── package.json
├── src
│ ├── config.tsx
│ ├── index.css
│ ├── index.html
│ └── index.tsx
└── tsconfig.json
/src/index.tsx
– The entry point of our app. It renders a component into the specified locations the Contentful web app./src/config.tsx
– The app configuration page of our app. It takes the App SDK as a prop, handles the loading state, and renders 'Hello World!'./src/index.html
– A simple HTML file loading in our React app./src/index.css
– A CSS reset file.
Read the docs for more information.