Skip to content

storyblok/next.js-ultimate-tutorial

Repository files navigation

The Storyblok Next Ultimate Tutorial

In this tutorial series, you will learn how to build a headless website using Storyblok and Next.js. Starting with the fundamental integration of Storyblok in Next.js, more advanced functionalities are explained in bite-sized content pieces, such as dynamic page rendering, dynamic menus, custom components, multilingual content and more.

You can switch between the different branches of this repository; there is one branch for each tutorial part. Alternatively, you may want to check out the live demos on StackBlitz. You can even replicate the corresponding Storyblok space for each of the tutorial parts in order to explore its exact configuration.

Tutorial Parts

Part 1

Part 2

Part 3

Part 4

Part 5

Part 6

Part 7

Requirements

To use this project you have to have a Storyblok account. If you don't have one yet you can register at Storyblok, it's free.

How to get started?

1. Clone the repo

  $ git clone https://github.com/storyblok/next.js-ultimate-tutorial.git

2. Install all dependecies

$  yarn # or npm install

3. Adding the Access token

Create a new empty Space and exchange the preview token with your own in pages/_app.js.

// in pages/_app.js
storyblokInit({
  accessToken: "your-preview-token",
  // for spaces located in the US:
  // apiOptions: {
  //   region: "us",
  // },
  use: [apiPlugin],
  components,
});

4. Run your project

Set the preview domain in Storyblok to http://localhost:3000/

# to run in developer mode
$ yarn dev # or npm run dev
# to build your project
$ yarn build # or npm run build

Resources