Home

Awesome

[!NOTE] This repo has been archived, but the Sanity / Shopify Studio is still maintained and is available via our CLI. To install, run npm create sanity@latest -- --template shopify

Sanity Studio for Shopify Projects

<p><img src="https://user-images.githubusercontent.com/209129/173606241-ae6694f7-57f0-4ed7-9d05-60c563c4233b.png" width="800" /></p>

About

This Sanity Studio is configured for headless Shopify projects that use the official Sanity Connect app, allowing you to extend Shopify products and collections with your own rich editorial content.

It contains examples of customizing your desk structure, document actions and input components.

This studio can be used with our Hydrogen starter, your frontend, or anywhere else you want your e-commerce content to go.

Features

This studio comes preconfigured with Shopify-friendly content schemas and a whole host of customizations to make managing Shopify data in your Sanity studio easier.

It also comes with several convenient layout modules which can be re-used across various pages.

View studio features

Assumptions

No two custom storefronts are the same, and we've taken a few strong opinions on how we've approached this studio.

We believe these rules work well for simpler use cases, and keeping product titles, images and slugs handled by Shopify helps keep content consistent as you navigate from your product views to the cart and ultimately checkout. Managing collections in Shopify gives you the flexibility to take full advantage of manual and automated collections.

You may have differing opinions on how content best be modeled to fit your particular needs – this is normal and encouraged! Fortunately, Sanity was built with this flexibility in mind, and we've written a guide on structured content patterns of e-commerce which may help inform how to tackle this challenge.

Setup

If you're reading this on GitHub, chances are you haven't initialized the studio locally yet. To do so, run the following shell command:

# run a one-off initializing script:
npx @sanity/cli init --template shopify

Make sure to run the tagged release! (@sanity/cli)

Local Development

Starting development server

npm run dev

Deploying the studio

npm run deploy

Upgrading Sanity Studio

npm install sanity@latest

If you have the Sanity CLI installed, you can also run this with sanity start|deploy|upgrade. It comes with additional useful functionality.

Upgrading from an old version?

We've updated some of the schema in this template to support deploying a GraphQL API, as well as making updates to remove schema warnings in v3 of the Sanity Studio. There are some breaking changes in these updates, which may mean you see schema warnings in the Studio. Please see migrations/strictSchema.ts as a guide to migrate your data. Don't forget to take a backup before making any changes!

License

This repository is published under the MIT license.