Skip to content

stipsan/sanity-meetup-08-22

Repository files navigation

v3 does what v2 don't - Sanity.io Meetup

Watch

How to run the demos locally

Async config demo

  1. cd 010 && npm i
  2. cp .env.example .env.development and modify .env.development with your own Sanity project
  3. npm run sanity:dev

Nextjs config demo

Live bookmarks.studio

  1. cd 010 && npm i
  2. cp .env.example .env and modify .env with your own Sanity project
  3. npm run dev

Use the Deploy button to end up with a working instance of the demo:

Deploy with Vercel

This demo only works if you're logged in to the studio, it doesn't pair with the unstable_noAuthBoundary API that the other demos are using.

This demo shows how one Studio instance: https://sanity.parts/blog/desk

Is reused and deployed on two other sites:

You can start by deploying your own:

Deploy with Vercel

  1. npm i && npm run build:vX
  2. Push the commit to trigger a new vercel deploy.
  3. Make a new site, somewhere, and paste a snippet like this:
    <div id="sanity"></div>
    <script type="module">
      import { createStudio } from 'https://projectId.sanity-parts.vercel.app/vX/blog.js'
      createStudio(document.querySelector('#sanity'), {
        projectId: 'projectId',
        dataset: 'production',
        title: 'Sanity Studio',
      })
    </script>
  4. Now, whenever you run npm run build:vX and push all the Studios using it will update 😉