/salesforce-commerce:sf-b2c-pwa-kitfrom salesforce-commerce
Builds headless B2C storefronts using Salesforce PWA Kit: React-based SSR, Managed Runtime deployment, Commerce SDK integration, and Chakra UI components.
Ships in salesforce-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/overview for PWA Kit documentationsite:github.com SalesforceCommerceCloud pwa-kit for source, examples, and starter templatessite:developer.salesforce.com pwa-kit commerce-sdk for Commerce SDK integrationsite:developer.salesforce.com pwa-kit managed-runtime deployment for deployment docsWhy: PWA Kit versions, Commerce SDK hooks, and Managed Runtime deployment procedures change across releases. Always verify the version in use (v2 vs v3+) before generating code.
PWA Kit is Salesforce's React-based framework for headless B2C Commerce:
| Aspect | Detail |
|---|---|
| Framework | React with custom SSR (NOT Remix, NOT Next.js) |
| Hosting | Managed Runtime (Salesforce CDN/edge) or self-hosted Node.js |
| API Layer | Commerce SDK -- typed access to SCAPI (Shopper APIs) |
| Authentication | SLAS (Shopper Login and API Access Service) |
| UI Library | Chakra UI (accessible, themeable components) |
| Extensibility | Override templates/components without forking |
pwa-kit-storefront/
├── app/
│ ├── pages/ # Route-based page components
│ ├── components/ # Shared React components
│ ├── hooks/ # Commerce SDK React hooks
│ └── routes.jsx # Centralized route definitions
├── config/default.js # Site config (API credentials, locales)
└── ssr.js # SSR server entry point
| Concept | Description |
|---|---|
| Data Fetching (v2) | getProps static method on page components -- runs server-side on initial load |
| Data Fetching (v3+) | withReactQuery and React Query hooks replace getProps |
| Routing | Centralized in app/routes.jsx (NOT file-based like Next.js); React Router syntax |
| SSR | Custom server-side rendering via ssr.js; hydration on client |
| Commerce SDK Hooks | useProduct, useCategories, useBasket, useCustomer, useSearchParams |
| Chakra UI | Box, Flex, Grid, Stack for layout; responsive array syntax fontSize={['sm', 'md']} |
| SLAS Auth | Guest tokens (automatic), registered login (OAuth), token refresh (transparent via SDK) |
routes.jsx.getServerSideProps.getProps; v3+ uses React Query. Check package.json before coding..env in production.The Commerce SDK is configured in config/default.js with Commerce API credentials (clientId, organizationId, shortCode, siteId). These values come from environment variables in production. The SDK handles SLAS authentication, token refresh, and SCAPI proxy routing transparently.
| Hook | Purpose | Returns |
|---|---|---|
useProduct(id) | Fetch product by ID | Product object with variants, images, prices |
useCategories(id) | Fetch category tree | Category with subcategories |
useBasket() | Cart management | Basket object with line items, totals |
useCustomer() | Customer profile | Customer data, authentication state |
useSearchParams() | Search and filtering | Search results with facets, pagination |
Fetch live docs for current hook signatures -- return types and parameters evolve across SDK versions.
Routes are defined explicitly in app/routes.jsx using React Router syntax. Page components in app/pages/ are NOT auto-discovered. Each route maps a URL pattern to a component with optional data fetching.
// Pattern: route definition skeleton
// Fetch live docs for current route config API
const routes = [
{ path: '/', component: Home, exact: true },
{ path: '/product/:productId', component: ProductDetail },
]
| Phase | Description |
|---|---|
| Server render | ssr.js processes the request; getProps (v2) or React Query (v3+) fetches data |
| HTML delivery | Fully rendered HTML sent to browser with embedded state |
| Client hydration | React hydrates the server-rendered HTML and attaches event handlers |
| Client navigation | Subsequent navigation is client-side via React Router |
| Target | Method |
|---|---|
| Managed Runtime | npm run push -- -m "message" via CLI; global CDN, auto-SSL, environment management |
| Self-hosted | Any Node.js host (AWS, Heroku, Vercel); manual SCAPI proxy configuration needed |
Managed Runtime environments: development, staging, production. Each environment has independent configuration in Runtime Admin.
Override templates and components without forking the base:
Chakra UI is the default component library. Customize via extendTheme():
fontSize={['sm', 'md', 'lg']} maps to breakpoints.# Pattern: create new PWA Kit project
# Fetch live docs for current CLI options
npx @salesforce/pwa-kit-create-app
// Pattern: page component skeleton
// Fetch live docs for current data fetching API
const MyPage = ({ data }) => <Box>{data.name}</Box>
export default MyPage
config/default.js environment-aware; never hardcode API credentials.getProps or React Query) -- never useEffect for initial data.Fetch the PWA Kit docs, Commerce SDK reference, and Managed Runtime deployment guide for exact component APIs, SDK method signatures, and configuration options before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/js-modernWrite modern JavaScript and TypeScript — ES6+ features, async/await, modules, destructuring, optional chaining, TypeScript types. Covers SFCC server-side JS (CommonJS, limited ES6), PWA Kit (full modern JS/TS), and LWC JavaScript (Lightning Locker constraints). Use when writing JavaScript for Salesforce Commerce./node-backendBuild Node.js backends for Salesforce Commerce — SFCC server-side JavaScript (not actual Node.js runtime), PWA Kit backend (Express-like SSR server), Commerce SDK for server-side SCAPI access, and async patterns for external service integration. Use when building server-side commerce logic./react-patternsBuild React applications for PWA Kit — hooks, composition, SSR, Commerce SDK integration, Chakra UI components, getProps data fetching, and client-side state management. PWA Kit uses React (NOT Remix/Next.js). Use when building PWA Kit storefronts./sf-b2b-apexBuild B2B Commerce Apex extensions using the CartExtension namespace — PricingCartCalculator, ShippingCartCalculator, TaxCartCalculator, InventoryCartCalculator implementations, governor limits, bulkification, test coverage (75% minimum), and checkout flow customization. Use when implementing server-side B2B commerce logic./sf-b2b-experienceBuild B2B Commerce storefronts with Experience Builder — LWR templates, page types (Home, Product, Category, Cart, Checkout), standard and custom components, theme layouts, navigation, SEO configuration, and site publishing. Use when assembling B2B/D2C storefronts./sf-b2b-lwcBuild B2B Commerce LWC components — Lightning Web Components with @api/@track/@wire decorators, commerce-specific wire adapters, custom events, Lightning Web Security, Jest unit testing, and component lifecycle. Use when building B2B storefront UI components.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceOther plugins' skills for the same job