This repository is a Next.js Storyblok Edgio starter template used in following guide.
To use this project you have to have a Storyblok and Edgio account. If you don't have one yet you can register at Storyblok and Edgio, both are free!
Read the Next.js tutorial about connecting Storyblok and Next.js
git clone https://github.com/rishi-raj-jain/next-storyblok-edgio-starter.git
npm install
Create a new empty Space and exchange the preview token with your own in lib/storyblok.js
.
// in lib/storyblok.js
const Storyblok = new StoryblokClient({
accessToken: "your-preview-token", // process.env.STORYBLOK_API_TOKEN (refer to .env.example)
cache: {
clear: "auto",
type: "memory",
},
});
Set the preview domain in Storyblok to http://localhost:3000/
npm run dev
npm i -g @edgio/cli
edgio init
edgio build && edgio run --production
edgio deploy
Follow this section of guide to add STORYBLOK_API_TOKEN and EDGIO_DEPLOY_TOKEN for integrating it with GitHub Workflows.