ce-nextjs-patterns

Official

Advanced Next.js patterns for Commerce Engine.

Authorcommercengine
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides a cohesive set of Next.js integration patterns for Commerce Engine to streamline SSR, Server Actions, SSG/ISR, and secure token management in storefronts.

Core Features & Use Cases

  • Server Components & Cookies: context-aware storefront usage with cookies() on the server for authenticated data.
  • Server Actions for Mutations: place auth and cart mutations in Server Actions to safely write cookies and update state.
  • SSG/ISR Patterns: build-time data fetching and token caching to speed up static pages.
  • Root Layout Initialization: use storefront({ isRootLayout: true }) in the root layout to bootstrap anonymous sessions and maintain continuity.
  • Client-Server Token Sync: tokens read from browser cookies and refreshed automatically across contexts.

Quick Start

Create a Next.js app, install the Commerce Engine storefront SDK, and apply the provided patterns in your root layout and pages.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: ce-nextjs-patterns
Download link: https://github.com/commercengine/skills/archive/main.zip#ce-nextjs-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.