
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
create-next-contentful-app
Advanced tools
Cli tool to create Next.js project with Headless stack (Contentful, Algolia, GraphQL, Vercel, Storybook, Github Actions, and more).
The easiest way to get started with Next.js + Contenful is by using create-next-contentful-app
. This CLI tool enables you to quickly start building a new Next.js + Contentful application, with everything set up for you.
Before to run the command and create your Next.js + Contentful project, you must to have a Contentful space and create the necesary keys to setup the project and space content.
If you haven't created a Contentful account, go here and create it, you can use Google or Github if you prefer.
Once you create your account you will be given the option to create your space, if it does not appear you can go to the menu and click on the "Add space" button and follow the instructions (you can use a free space and then upgrade the plan).
In the Settings menu, you can access the "Locales" section.
Once there, you can create and/or configure your locales; at least one (the main one) is required for the operation of the project.
Remember to take into account the code of the language selected as the main language for the installation of the project; in the case of this example, we see that it is en-US
.
For the creation of the content model and the loading of the initial content it is necessary to create an access token to the Content Management API. To do this you must go to the menu Settings -> CMS Tokens
Once there, click on the "Create personal access token" button and follow the instructions.
Remember to add an expiration date according to your needs and security.
Copy and save the token in a safe place, at least until you perform the installation, because once you click the "Done" button, you will not be able to see the token again.
For the functioning of the website it is required to have the access tokens to the Content Management API and content in draft (preview token). To create these tokens you must go to the Settings -> API Keys menu:
Click on the "Add API keys" button.
Set an appropriate name and description; remember for security reasons to keep several API keys for your different environments.
Once created you can view the tokens by clicking on the "show" button in the "Content Delivery API - access token" and "Content Preview API - access token" fields.
One you finished your Contentful space setup, use the following command:
You can create a new project interactively by running:
npx create-next-contentful-app@latest
# or
yarn create next-contentful-app
# or
pnpm create next-contentful-app
# or
bunx create-next-contentful-app
You will be asked for the name of your project, and then whether you want to create a TypeScript project:
✔ Would you like to create the content model to your Contentful space? … No / Yes
✔ Would you like to import the initial data to your Contentful space? … No / Yes
Select Yes to install the initial contentful model and content examples.
You can also pass command line arguments to set up a new project
non-interactively. See create-next-contentful-app --help
:
Usage: create-next-contentful-app <project-directory> [options]
Options:
-v, --version Output the current version
--debug Output extra debugging (default: false)
--cf-space-id <contentful-space-id> ID of your Contentful space
--cf-cda-token <contentful-cda-token> Contentful delivery access token to query your contentful space/environment
--cf-env <contentful-environment> Contentful environment identifier
-h, --help display help for command
create-next-contentful-app
allows you to create a new Next.js + Contentful app within seconds. It is updated periodically maintained the lastest stable versions of Next.js and the packages needed for the project to run correctly, and includes a number of benefits:
npx create-next-contentful-app@latest
(with no arguments) launches an interactive experience that guides you through setting up a project.FAQs
Cli tool to create Next.js project with Headless stack (Contentful, Algolia, GraphQL, Vercel, Storybook, Github Actions, and more).
We found that create-next-contentful-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.