Search Documentation

Search for a documentation page...

Installation

Clone, configure, and run the YNS storefront template locally.

Clone the Template

Use create-next-app to clone the storefront:

npx create-next-app@latest my-store --example https://github.com/yournextstore/yournextstore

Or clone directly:

git clone https://github.com/yournextstore/yournextstore.git my-store
cd my-store

Install Dependencies

npm install
# or
pnpm install
# or
bun install

Environment Variables

Create a .env.local file in the project root:

YNS_API_KEY=sk-your-api-key-here

Get your API key from the YNS dashboard under Settings > API Keys.

Staging vs Production

  • Production keys (sk-...) connect to yns.store
  • Staging keys (sk-s-...) connect to yns.cx (sandbox)

The Commerce SDK automatically detects which environment to use based on the key prefix.

Run Development Server

npm run dev

The store will be available at localhost:3000.

Verify Setup

You should see your store's products on the homepage. If you see an error, check that:

  1. Your YNS_API_KEY is set correctly in .env.local
  2. Your store has at least one published product
  3. Your Stripe account is connected in the YNS dashboard