Import Demo Data
If you have a demo dataset (e.g., demo-data.tar.gz) provided with the project, you can import it to populate your Sanity project with initial content.
Follow the instructions below to import the demo data:
-
Install Sanity CLI (Optional if using npx): You can run commands using
npxwithout installing the CLI globally. -
Login to Sanity: Run the following command and follow the instructions to log in to your Sanity account.
npx sanity login -
Import the Data: Assuming you have the
demo-data.tar.gzfile in your project root:npx sanity dataset import ./demo-data.tar.gz productionNote: If your dataset is named differently (not
production), replaceproductionwith your actual dataset name. -
Verify: After the import completes, visit your Studio at
http://localhost:3000/studioto see the imported content. If everything was done properly you will see the demo products on your site.