Documentation for Next.js integration

After our first implementation (DatoCMS with Gatsby, Azure Functions and Mailjet) is online we are now starting to integrate also with Next.js. So, I came across the integration page, but it looks like a stub. Link and button to the documentation are not working.

Can you please lead me to the correct location where I can find some details about Next.js integration?

1 Like

hello @andreas.jahn!

You are right about the Next.JS integration page. It’s more of a landing page now to measure how many people are interested in that, so yes, it’s still a stub :frowning:

But here’s a minimal example of a Next.JS project using Dato:

What are you interested in specifically? If you have specific questions we can take them into account when we’ll write a guide for that.

Thank you!

New user, looking over the next integration code, why Is there a static,js file in the data folder? Also, how is the DATO_API_TOKEN, environment variable set?

Hello @social and welcome to Community! :slight_smile:

static.js was just an example, I’ve removed it, it’s not necessary.

and for the env variable I’m setting it with now: now -e DATO_API_TOKEN="mytoken"

does that help?

1 Like

Yes, thanks, working through the example all morning, Data Monday. Is the environment variable set with or without the quotes? I am getting a INVALID_AUTHORIZATION_HEADER - 401 Code

1 Like

@social The 401 error means that you are not passing the token correctly :frowning:

I tried using now secrets, command line with the “ “ and the token without, nothing seems to work.