This is sample Next.js starter site that uses Agility CMS and aims to be a foundation for building fully static sites using Next.js and Agility CMS.
New to Agility CMS? Sign up for a trial account
- We have updated this starter for Next.js 14. It is using a pre-release version of the @agility/nextjs npm package specialized for app router amd caching.
- Uses our
@agility/nextjs
package to make getting started with Agility CMS and Next.js easy - Support for Next.js 14 and app or pages router
- Support for fetch caching
- Supports routing from Agility sitemaps
- Supports Preview Mode
This starter uses Tailwind CSS, a simple and lightweight utility-first CSS framework packed with classes that can be composed to build any design, directly in your markup.
It also comes equipped with Autoprefixer, a plugin which use the data based on current browser popularity and property support to apply CSS prefixes for you.
This starter is written in TypeScript, with ESLint.
To start using the Agility CMS & Next.js Starter, sign up for a FREE account and create a new Instance using the Blog Template.
- Clone this repository
- Run
npm install
oryarn install
- Rename the
.env.local.example
file to.env.local
- Retrieve your
GUID
,API Keys (Preview/Fetch)
, andSecurity Key
from Agility CMS by going to Settings > API Keys.
How to Retrieve your GUID and API Keys from Agility
When running your site in development
mode, you will see the latest content in real-time from the CMS.
yarn install
yarn dev
This will launch the site in development mode, using your preview API key to pull in the latest content from Agility.
npm install
npm run dev
When running your site in production
mode, you will see the published content from Agility.
yarn build
yarn start
npm run build
npm run start
You can use the Agility Content Fetch SDK normally - either REST or GraphQL within server components.
The easiest way to deploy a Next.js website to production is to use Vercel from the creators of Next.js, or Netlify. Vercel and Netlify are all-in-one platforms - perfect for Next.js.
If you have feedback or questions about this starter, please use the Github Issues on this repo, or join our Community Slack Channel.