🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup
Back to changelog

Add support for API versioning

This release upgrades the picosanity dependency that brings support for configuring the client's API version:

import {
} from 'next-sanity'

const config = {
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET || 'production',
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
  useCdn: process.env.NODE_ENV === 'production',
apiVersion: '2021-03-25'
} export const sanityClient = createClient(config)

Published March 26, 2021