🚀 Getting Started

A quick setup. A lasting impact.

⚠️ Repository transition (effective May 31st, 2026)

This codebase will eventually be superseded by the updated SanityPress with TypeGen. Plan new projects and migrations toward that repo. After the transition date, this repository will be archived as sanitypress-2023 so the historical template remains available, while ongoing development focuses on TypeGen SanityPress.

1. Install with the Sanity CLI

  • npm create sanity@latest -- --template nuotsu/sanitypress

    You can also clone or fork the GitHub template to set up manually.

    2. Set environment variables

    .env.local
  • NEXT_PUBLIC_BASE_URL="" # https://sanitypress.dev
    
    NEXT_PUBLIC_SANITY_PROJECT_ID="..."
    NEXT_PUBLIC_SANITY_DATASET="production"
    
    SANITY_API_READ_TOKEN="..."
    
    NEXT_PUBLIC_SANITYPRESS_PRO_LICENSE_KEY="..."
    
    NEXT_PUBLIC_GITHUB_TOKEN="" # recommended to add to display GitHub stars & forks
    

    3. Start local servers

    Run the following command to start the development server:

  • npm run dev

    4. Add content

    In your new Sanity Studio, publish the required site and page documents:

    Document Slug Use Required? Notes
    site Global settings
    page index Homepage
    page 404 Page not found
    page blog Blog listing Add the Blog frontpage module
    global-module blog/ (path) Blog post Add the Blog post content module

    Alternatively, you can import the demo site dataset:

  • sanity dataset import src/sanity/demo.tar.gz

    5. Set up deployments

    Add a Vercel or Netlify widget to enable deployments from the Studio.

    6. Customize

    Adjust frontend styles, edit/add schema and modules, and more.

    Helpful Articles

    Read more on The Styled Heart Blog