SkillAgentSearch skills...

HULL

💀 Headless Shopify Starter – powered by Next.js + Sanity.io

Install / Use

/learn @ndimatteo/HULL

README

<p align="center"> <img src="public/HULL-Logo.svg" align="center" height="100" /> </p> <p align="center"> <strong>Headless Shopify starter built on <a href="https://nextjs.org">Next.js</a></strong> 🤘 <br /> <strong>Headless CMS powered by <a href="https://sanity.io">Sanity.io</a></strong> ⚡<br /> </p> <p align="center"> <a href="https://hull.dev"> <img src="https://img.shields.io/static/v1?label=&message=View%20Demo&style=for-the-badge&color=black&logo=vercel" /> </a> <br /> <a href="https://www.sanity.io/create?template=ndimatteo/HULL"> <img src="https://img.shields.io/static/v1?label=Sanity&message=Create%20Project&style=for-the-badge&color=156dff&labelColor=black" /> </a> </p> <p align="center"> <a href="#-features">Features</a> • <a href="#-tours">Tours</a> • <a href="#-automatic-set-up">Set Up</a> • <a href="#-spin-up">Spin Up</a> • <a href="#-deployment">Deployment</a> • <a href="#-extrastips">Extras</a> </p> <br /> <br />

✨ Features

  • Utility-first CSS with Tailwind CSS
  • Animations powered by Framer Motion
  • Cart powered by Shopify Buy SDK
  • Real-time inventory check for products using SWR
  • Customizable Filtering & Sorting for product collections
  • Klaviyo waitlist form for out-of-stock products
  • Klaviyo newsletter form with opt-in field
  • Dynamic Page Routes for custom page creation
  • Automatic Sitemap.xml generation
  • Automatic robots.txt generation
  • Automatic 301 Redirects from Sanity
  • Live Preview content directly from Sanity
  • Modern Image component using Sanity's Hotspot, Crop, and automatic WEBP format
  • Modular page content for all pages, including dynamic grid layouts
  • Customizable Promotion Banner
  • Customizable Cookie Notice
  • Accessibility features:
    • ARIA Landmark Roles
    • Default focus states preserved for keyboard navigation
    • Correctly trap focus for drawers with focus-trap-react
    • Roving tabindex for radio buttons
    • Input-based quantity counters
    • Required alt text for all images
    • "Skip to Content" link
  • SEO features:
    • Page-level SEO/Share settings with previews
    • Fallback Global SEO/Share settings
    • Automatic JSON-LD Schema markup for products

Shopify Integration Features

  • Automatically syncs products from Shopify into Sanity
  • Custom action to sync product cart thumbnails back to Shopify from Sanity
  • Tracks product status (draft/published) from Shopify to help control visibility while editing
  • Deleted products and variants are preserved and flagged in Sanity
  • Updates the URL on variant changes while keeping a clean history stack
  • Vanity shop URL masking
  • Global Cart with access to all variant data for line items
  • Supports Single Variant products out of the box
  • Product photo galleries with variant granularity
  • Dynamic /shop collection page
  • Custom collection pages
  • Ability to surface a variant option on product cards
<br />

🎧 Tours

Still not sold? Here's some videos to get you psyched:

Famous 5-Minute Setup™ - Coming Soon <br /> From sync to sale, watch me spin up a fresh storefront in under 5 minutes!

Explore the file Structure - Coming Soon <br /> In-depth look at the file structure, naming conventions, and logic under the hood

Setting up your first Product - Coming Soon <br /> Explore the Product settings within Sanity and how to properly setup PDP pages and PLP cards

Connecting to Klaviyo and testing your Forms - Coming Soon <br /> Learn how to quickly connect Klaviyo to utilize product waitlist and newsletter forms

Setup your first Vercel deployment - Coming Soon <br /> Using the Sanity Vercel Deploy plugin, see how easy it is to empower your clients to trigger deploys

<br />

🔥 Automatic Set Up

Quickly deploy as a Sanity Starter on Vercel with a pre-populated store! Once deployed, simply follow step 2 and 3 below to connect your Shopify store.

Warning <br />You should delete the demo products once you connect your own Shopify account. Demo products will not function properly as they are not part of your Shopify store. Additionally, any existing products in your Shopify store will not automatically sync into Sanity. To trigger a sync, you must make a change to your existing product(s) in Shopify first.

<br />

💀 Manual Set Up

Clone this repository from your GitHub account with the Use this template button

1) Sanity

  1. Initialize and build the Sanity Studio
    • Make sure you have the Sanity CLI installed globally first
    • yarn && sanity init in the /studio folder
    • During Sanity's initalization it will warn you that the Sanity Studio is already configured. Type Y and hit enter to reconfigure it to your own project
    • When it asks you what dataset configuration to use, go with the default
  2. Add CORS Origins to Sanity project
    • Visit manage.sanity.io and go to [your-project] > API > "CORS origins"
    • Add your Studio URLs with credentials: http://localhost:3333 and [subdomain].sanity.studio
    • Add your front-end URLs without credentials: http://localhost:3000 and https://[subdomain].vercel.app

2) Shopify Storefront Access

  1. Allow custom app development in Shopify
    • Go to "Settings" (bottom left) > "Apps and sales channels" > "Develop apps" (top right)
    • click "Allow custom app development"
  2. Create a custom app in Shopify
    • Go to "Settings" (bottom left) > "Apps and sales channels" > "Develop apps" (top right)
    • click "Create an app"
    • Give this a relevant App name, I prefer: "Headless Storefront", so it's clear what it's being used for
    • Use your dev account as the App developer to know when there are issues
  3. Configure Admin API scopes
    • Configuration > Admin API integration > "Configure"
    • Check the following boxes for the "Products" scope: write_products and read_products
  4. Configure Storefront API scopes
    • Configuration > Storefront API integration > "Configure"
    • Check the following boxes for the "Products" scope: unauthenticated_read_product_listings and unauthenticated_read_product_inventory
    • Check the following boxes for the "Checkout" scope: unauthenticated_write_checkouts and unauthenticated_read_checkouts
  5. Install the App

3) Shopify Webhooks

  1. Go to "Settings" (bottom left) -> "Notifications" -> "Webhooks" (very bottom)
  2. add the following webhooks with the (Latest) stable API version:
    • Product creation - [live-domain]/api/shopify/product-update
    • Product update - [live-domain]/api/shopify/product-update
    • Product deletion - [live-domain]/api/shopify/product-delete

      Warning <br />You have to use a real, live domain name (not localhost!). Be sure to use your Vercel project URL during development, and then switch to the production domain once live. You may not know your Vercel project URL until you deploy, feel free to enter something temporary, but make sure to update this once deployed!

4) NextJS

  1. yarn in the project root folder on local
  2. Create an .env.local file in the project folder, and add the following variables:
NEXT_PUBLIC_SANITY_PROJECT_DATASET=production
NEXT_PUBLIC_SANITY_PROJECT_ID=XXXXXX
SANITY_API_TOKEN=XXXXXX
SANITY_STUDIO_PREVIEW_SECRET=XXXXXX

NEXT_PUBLIC_SHOPIFY_STORE_ID=XXXXXX
NEXT_PUBLIC_SHOPIFY_STOREFRONT_API_TOKEN=XXXXXX
SHOPIFY_ADMIN_API_TOKEN=XXXXXX
SHOPIFY_WEBHOOK_INTEGRITY=XXXXXX

// Needed for Klaviyo forms:
KLAVIYO_API_KEY=XXXXXX

// Needed for Mailchimp forms:
MAILCHIMP_API_KEY=XXXXXX-usX
MAILCHIMP_SERVER=usX

// Needed for SendGrid forms:
SENDGRID_API_KEY=XXXXXX
  1. Update all the XXXXXX values, here's where to find each:
  • NEXT_PUBLIC_SANITY_PROJECT_ID - You can grab this after you've initalized Sanity, either from the studio/sanity.json file, or from your Sanity Manage dashboard
  • SANITY_API_TOKEN - Generate an API token for your Sanity project. Access your project from the Sanity Manage dashboard, and navigate to: "Settings" -> "API" -> "Add New Token" button. Make sure you give read + write access!
  • SANITY_STUDIO_PREVIEW_SECRET - A unique string of your choice. This is used to confirm the authenticity of "preview mode" requests from the Sanity Studio
  • NEXT_PUBLIC_SHOPIFY_STORE_ID - This is your Shopify store ID, it's the subdomain behind .myshopify.com
  • NEXT_PUBLIC_SHOPIFY_STOREFRONT_API_TOKEN - Copy the Storefront API access token from "Apps" -> "Develop apps" -> [your_custom_app] -> "API credentials".
  • SHOPIFY_ADMIN_API_TOKEN - Copy the Admin API access token from "Apps" -> "Develop apps" -> [your_custom_app] -> "API credentials". (Note: you’ll only be able to reveal your Admin API token once.)
  • SHOPIFY_WEBHOOK_INTEGRITY - Copy the Integrity hash from "Settings" -> "Notifications" -> "Webhooks" (very bottom of page)
  • KLAVIYO_API_KEY - Create a Private API Key from your Klaviyo Account "Settings" -> "API Keys"
  • MAILCHIMP_API_KEY - Create an API key from "Account -> "Extras" -> API Keys
  • MAILCHIMP_SERVER - This is the server your account is from. It's in the URL when logged in and at the end of your API Key
  • SENDGRID_API_KEY - Create an API key from "Settings" -> "API Keys" with "Restricted Access" to only "Mail Send"
  1. Create an .env.production and .env.development file in the /studio folder, and add the following (using the same value as above):
SANITY_STUDIO_PREVIEW_SECRET=XXXXXX

5) Shopify Store Theme

Since we're serving our store through a headless environment, we don't want visitors accessing our unused sho

Related Skills

View on GitHub
GitHub Stars1.4k
CategoryDevelopment
Updated6d ago
Forks171

Languages

JavaScript

Security Score

100/100

Audited on Apr 3, 2026

No findings