Hi there 👋! This is a repo for my talk on YouTube, from the Sanity.io Virtual Meetup - Autumn 2022.
When I was working on a new project that involved Sveltekit and Sanity I got curious and wanted to know whether I could directly embed the Sanity Studio V3 (Release Candiate) into a SvelteKit app. I was living on the edge already, so I might as well embrace it 🌈
I also go over on how we use Sanity's Side-by-side Instant Content preview feature with Sveltekit. And how you can easily implement this in your own SvelteKit applications. The code (createPreviewSubscriptionStore) is mostly inspired from Sanity's toolkit for Next.js.
Once you've created a project and installed dependencies with pnpm install
. Make sure you have added all the environment variables (see env.example).
pnpm dev
# or start the server and open the app in a new browser tab
pnpm dev -- --open
To build the project, run:
pnpm build
To preview the build, run:
pnpm preview