Skip to content
Watch a live product demo 👀 See how Sanity powers richer commerce experiences
Sanity
  • Platform

    Sanity Studio

    Flexible editing environment

    APIs

    Connect to anything

    Content Lake

    Real-time database

    Watch product demo

    Features

    Real-time collaboration

    Fearlessly work with content

    Precise content querying

    Treat content as data with GROQ

    Localization

    Coherent messaging across territories

  • Use cases

    E-commerce

    Richer shopping experiences

    Marketing sites

    Control your story

    Products & services

    Innovate and automate

    Mobile apps

    Content backend for every OS

    View all

    Integrations

    Shopify
    Mux
    Vercel
    Netlify
    Algolia
    Cloudinary
    BigCommerce
    Commerce Layer
    Smartling
    Transifex
    View all
  • Learn

    Documentation
    API reference
    Guides
    GROQ cheat sheet
    Sanity UI
    Get started

    Build and share

    Templates
    Tools and plugins
    Schemas and snippets
    Project showcase
    Share your work
    Browse Exchange

    Frameworks

    React
    Vue
    Next.js
    Nuxt.js
    Svelte
    Remix
    Gatsby
    Astro
    Angular
    Eleventy
    View all
  • Discover

    Blog
    Resource library
    Agency partners
    Become a partner
    Technical support
    Talk to sales

    Case studies

    Puma

    Source of truth for all global markets

    Aether

    Unique digital shopping experience

    Morning Brew

    Omnichannel media distribution

    InVision

    Delivering exceptional customer experiences

    View all

    Popular guides

    Structured content
    Content modeling
    Headless CMS
    Headless SEO
    Static websites
    View all
  • Enterprise
  • Pricing
  • Log in
  • Contact sales
  • Get started
Contact salesGet started
Published July 15th 2021

Announcing the Sanity Content Lake integration for Vercel

Now available on the Vercel Marketplace

Knut Melvær

Principal Developer Marketing Manager

The Sanity Content Lake can be used as a real-time data backend for any application. Our new integration on the Vercel marketplace easily lets you connect your project to a new Sanity.io dataset to start storing, synchronizing, and querying data over our APIs. Find out later you needed a fully-fledged, yet friendly editing interface with version control and collaboration? Sure, just configure schemas and set up a Sanity Studio for your content team.

Not all projects start by defining an editing environment and elaborate content models. Sometimes you need some “JSON in the cloud”. Since Sanity.io offers a fully decoupled NoSQL document backend, you can use this integration to quickly get up and running and have an endpoint where you can store and retrieve content to your app. No need to set up schemas or anything else, just give your object a _type and add it to your Content Lake with an authenticated POST request to the mutation API, or by using one of Sanity's SDKs.

As your project evolves, and whenever the time is right, you can create a Studio and configure it to display the content types and fields that you want to be editable within it.

If you use Next.js deployed on Vercel, you can use API routes to handle form submissions or the like. This is what a minimal implementation can look like using the environment variables that are set up by the integration:

const sanityClient = require('@sanity/client');

const config = {
  projectId: process.env.SANITY_API_PROJECT_ID,
  dataset: process.env.SANITY_API_DATASET,
  token: process.env.SANITY_API_WRITE_TOKEN,
  useCdn: false,
  apiVersion: '2021-03-25'
};
/*
 * Shape of body:
 * { 
 *   "_type": "submission", 
 *	 "_id": "form.657cf48a-e824-4c8a-b474-6b63368a330f”, 
 *   "name": "Andy Bernard",
 *   "message": "This musical rocks!"
 *  }
 */
async function handleForm(req, res) {
  const payload = JSON.parse(req.body);
  try {
    const result = await sanityClient(config).create(payload);
    return res.status(200).send('ok');
  } catch (error) {
    return res.status(500)send('error');
  }
}

export default handleForm;

We hope that our integration can be useful and improve the developer experience for projects that combine Vercel and Sanity.io. As always, if you build with this stack, we'd love to learn all about it on sanity.io/projects and in our community on slack.sanity.io.

Product

Sanity StudioAPIsContent LakeSecurity & Compliance
  • Sanity vs Contentful
  • Sanity vs Strapi
  • Sanity vs Wordpress
  • Sanity vs Adobe Experience Manager
  • Sanity vs Hygraph
  • Sanity vs Sitecore
  • Sanity vs Storyblok
  • Sanity vs Contentstack
  • Sanity vs Prismic
  • Sanity vs Drupal
  • Sanity vs ButterCMS

Resources

DocumentationBlogResource libraryCase Studies
  • React Blog
  • Gatsby Blog
  • Next.js Landing Pages
  • Progressive Web Application
  • Single Page Application
  • Svelte & Typescript App
  • Vue & Tailwind Blog
  • Developer Portfolio Templates
  • Form validation with Yup
  • Live Preview with Next.js and Sanity.io
  • Next.js blog
  • Next.js personal website
  • Clean Next.js + Sanity app
  • Clean Remix + Sanity app
  • Clean SvelteKit + Sanity app
  • All Templates
  • Agency partners
  • Technology partners
  • Headless CMS 101
  • What is an API CMS
  • Static Sites 101
  • Headless Commerce 101
  • Headless SEO
  • Localization
  • GraphQL vs REST
  • Content as a Service
  • What is a DXP?
  • Typescript 101
  • Ecommerce SEO
  • React CMS
  • Next.JS CMS
  • CMS for Shopify
  • Content platform
  • Multilingual CMS
  • Static Site CMS
  • Gatsby CMS
  • Node CMS
  • E-commerce CMS
  • Vue CMS
  • Angular CMS
  • GraphQL CMS
  • Newspaper CMS
  • Magazine CMS
  • CMS for apps
  • Remix CMS

Company

Contact SalesEnterpriseCareersTerms of ServicePrivacy PolicyAccessibility Statement

Stay connected

  • GitHub
  • Slack
  • Twitter
  • YouTube
  • Stack Overflow
  • Blog RSS
  • Newsletter
©Sanity 2023