Using the Sanity Hydrogen demo and connecting to a test store/client stores.
No, the test data doesn't automatically populate when you run npm install or yarn install. Looking at the Sanity Hydrogen demo repository, you'll need to take some additional steps to get the demo data set up.
The installation process requires you to:
Set up Sanity Connect for Shopify first - The README mentions "These installation instructions assume you have already installed and configured Sanity Connect on your Shopify store." This is what syncs products and collections from Shopify into your Sanity dataset.
Configure your environment variables - You need to duplicate the
.env.examplefile to.envand add your own Sanity project credentials (projectIdanddataset) plus your Shopify storefront credentials (storeDomainandstorefrontToken).Import test data separately - The test data mentioned in the repo isn't automatically loaded during installation. You'll need to either:
- Use Sanity Connect to sync products from a Shopify store (which could be a test store with demo products)
- Manually import a test dataset using Sanity's CLI tools if there's a dataset export available
The npm install command only installs the JavaScript dependencies needed to run the application - it doesn't populate your Sanity dataset with content. The demo storefront at demo-ecommerce.sanity.build is connected to a pre-configured Sanity dataset with demo content, but when you clone the repo locally, you're starting with your own empty dataset that you'll need to populate.
Quick tip coming from Nuxt/Vue: Since you're used to that ecosystem, you'll find Hydrogen's React-based approach pretty straightforward. The demo uses server components and Hydrogen's useQuery hook, which is similar to data fetching patterns you might have used with Nuxt's useFetch or useAsyncData.
If you're looking for test data specifically to get started quickly, you might want to check the repository's issues or discussions to see if there's an export available, or reach out to the Sanity community in their Slack about accessing demo dataset content.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.