Skip to content
VercelLogotypeVercelLogotype
LoginSign Up

Next.js + Salesforce Commerce Cloud

Starter kit for high-performance commerce with Salesforce Commerce Cloud and Next.js.

DeployView Demo

Next.js Commerce + Salesforce Commerce Cloud

A high-perfomance, server-rendered Next.js App Router ecommerce application.

This template uses React Server Components, Server Actions, Suspense, useOptimistic, use cache and more.

Providers

This version of Next.js Commerce is integrated with Salesforce Commerce Cloud. The integration code for Salesforce Commerce Cloud can be found in the lib/sfcc directory.

For information on other commerce providers, additional details, and the core Next.js Commerce template, please refer to the official Next.js Commerce repository.

Enviroment variables

This project requires the following environment variables for connecting to Salesforce Commerce Cloud:

SFCC_ORGANIZATIONID=""
SFCC_SHORTCODE=""
SFCC_SITEID="RefArch"
SFCC_CLIENT_ID=""
SFCC_SECRET=""
SITE_NAME="ACME Store"
SFCC_REVALIDATION_SECRET=""
  • SFCC_ORGANIZATIONID: Salesforce Commerce Cloud Organization ID
  • SFCC_SHORTCODE: Salesforce Commerce Cloud instance short code
  • SFCC_SITEID: ID of the target site
  • SFCC_CLIENT_ID: SLAS API Client ID
  • SFCC_SECRET: SLAS API Client Secret
  • SITE_NAME: User-defined name for the site
  • SFCC_REVALIDATION_SECRET: User-defined string for on-demand revalidation

Please refer to the official Salesforce Commerce API documentation for details on how to retrieve these values:

  • Base URL Configuration
  • SLAS Authorization

Store configuration

This project works with a standard Salesforce Commerce Cloud RefArch site with minimal modifications. However, for the homepage to display content correctly, two product categories must be created:

  • hidden-homepage-carousel: This category populates the main carousel on the homepage
  • hidden-homepage-featured-items: This category populates the featured products section on the homepage

Create these two categories and assign products to them within Business Manager.

Running locally

You will need to use the environment variables defined in .env.example to run Next.js Commerce. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets that will allow others to control your Salesforce Commerce Cloud store.

  1. Install Vercel CLI: npm i -g vercel
  2. Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link
  3. Download your environment variables: vercel env pull
pnpm install
pnpm dev

Your app should now be running on localhost:3000.

GitHub
Ownervercel-partner-solutions
Repositorynextjs-salesforce-commerce-cloud
LicenseView License
Use Cases
Ecommerce
Stack
Next.js
Tailwind

Related Templates

Next.js Commerce

Starter kit for high-performance commerce with Shopify.
Next.js Commerce thumbnail

Platforms Starter Kit

Next.js template for building multi-tenant applications with the App Router and Redis.
Platforms Starter Kit thumbnail

Next.js + BigCommerce Starter

A Next.js 14 and App Router-ready headless storefront template for BigCommerce.
Next.js + BigCommerce Starter thumbnail

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • EveNew
  • ConnectNew

Core Platform

  • CI/CD
  • Content Delivery
  • Fluid Compute
  • Observability

Security

  • Platform Security
  • WAF
  • Bot Management
  • Bot ID

Tools

  • Vercel DropNew
  • Vercel Agent
  • Vercel PluginNew
  • Next.js
  • Domains
  • v0

Frameworks

  • Nuxt
  • SvelteKit
  • Nitro
  • Turborepo
  • Tanstack Start
  • FastAPI
  • xmcp
  • All frameworks

SDKs

  • Vercel SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDKNew
  • Queues SDKNew
  • Streamdown

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
  • Platform Engineers
  • Design Engineers

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Articles
  • Community

Explore

  • Customers
  • Marketplace
  • Templates
  • Partner Finder
  • Vercel + AWS

Company

  • About
  • Careers
  • Press
  • Events
  • Startups
  • Shipped on Vercel
  • Open Source Program
  • Enterprise
  • Pricing
  • Help

Legal & Trust

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA
  • Acceptable Use Policy
  • Legal (all documents)
  • Trust Center
  • Status

Social

  • GitHub
  • X
  • LinkedIn
  • YouTube
  • Instagram
  • VercelVercel
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD
Tools
  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
EnterprisePricing
Contact
Log InSign Up
Dashboard

Products

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Eve

Core Platform

  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD

Tools

  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Resources

Learn

  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce

Explore

  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
Enterprise
Pricing
Sign UpLog In
Contact
DeployView Demo

Loading status…

Select a display theme: