Announcing the Sanity Content Lake integration for Vercel
Now available on the Vercel Marketplace

Knut Melvær
Principal Developer Marketing Manager
Published
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
Not all projects start by defining an _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
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.