A New Native Authoring Experience and Starter for Next.js (ssr)

Written by Knut Melvær

Missing Image!

It’s Next.js Conf week, and we wanted to mark the occasion by sharing something we have made for you: A new Next.js starter with a native authoring experience. You can get it up and running in minutes by deploying it from GitHub.

PortableText [components.type] is missing "callToAction"
A screenshot of Sanity Studio v3 showing the content editing form on the left and the preview of a post in Next.js on the right

We have added a bunch of features that will benefit developing a content-rich site with Next.js:

We hope you will give it a spin and tell us what you think on Twitter and in the community!

Create content experiences without compromise

If your team is building a web app, you’ll need to work with content: deciding how it's authored, stored, and distributed. Often it’s up to developers to make some choices with trade-offs:

We built Sanity to help resolve these trade-offs. You shouldn’t have to deal with hosting your own databases; instead, you should get performant and flexible content APIs. You should get a content authoring framework that lets you get up and running quickly but also be customizable as needs come up (which they always do). And the trade-off of having your content hosted in the cloud should be as palatable as possible with the ability to start for free, and then move to pay-as-you-go API quotas as you grow.

A new native authoring experience for Next.js

We built the new version of the Sanity Studio framework as “just a React dependency.” That means you can mount the whole authoring experience on a Next.js route and access it on a URL on your website (like /wp-admin on a WordPress site). You don’t need to deal with a monorepo (unless you want to), and additional build tools. Customizing the Studio follows the same patterns you're used to from Next.js, React, and JavaScript.

We aren’t the first ones to offer a native authoring experience for Next.js. There are some cool projects that put a WYSIWYG editor on top of Markdown files and git. But they don't meet the needs of projects and teams that scale. You risk race conditions when more than one person edits the same content, and you start to get commits into your git history (”fix typo”) that have nothing to do with the functionality of your web app. It can get messy!

Furthermore, having your content available as structured content in a real-time document store (we call it Content Lake) also makes it possible to build content previews for Next.js that don’t require you to deploy new git branches. When a user is logged into the authoring environment, we can leverage their authentication, fetch draft content, and inject them into the page properties with React. And the preview isn’t restricted to only a given page. This is just one of the reasons we’re stoked about all the possibilities this experience opens up.

Learn more at the Next.js conference and save the date for the Sanity Product Event in December!

If you attend the virtual or in-person Next.js conference, then we would like to meet you and learn what you’re working on. You can find us on the show floor and on the conference Discord. We will also be on stage on October 25th to tell you more about using Sanity with Next.js:

We’d also like to invite you to pre-register and save the date for the Sanity Product Event on December 8th, 2022.

Join the Sanity team, our customers, and partners for an event on December 8th. We'll share our product vision and share the latest developments from Sanity HQ

PortableText [components.type] is missing "callToAction"