👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Questions about using Sanity.io with Next.js directory structure

1 replies
Last updated: Jun 10, 2023
Hi all! I'm using a Next.js app with a directory structure, and I have several questions regarding how to fetch data from Sanity.io . It seems that the documentation has changed because I can't find the getStaticProps and getServerSideProps functions. Has anyone successfully created a project using Sanity.io in Next.js?
Jun 10, 2023, 5:29 PM
getStaticProps and getServerSideProps are in the docs under the Pages Router. The default is now the Apps Router, and you won’t find them there.
Jun 10, 2023, 5:36 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?