Next.js + Salesforce Commerce Cloud

R
Renaudil y a 2 jours
0

Description

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

npx boilerapp next-js-salesforce-commerce-cloud

文档

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:

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.

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联系我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联系我们,我们将尽快回复。

Next.js + Salesforce Commerce Cloud | BoilerApp