@salesforce/b2c-dx-mcp 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/bin/run.js +5 -9
  2. package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
  3. package/content/guidance/b2c/b2c-onboarding/SKILL.md +4 -4
  4. package/content/guidance/b2c/b2c-ordering/SKILL.md +2 -2
  5. package/content/guidance/b2c/b2c-querying-data/SKILL.md +2 -2
  6. package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +3 -3
  7. package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
  8. package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +6 -6
  9. package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
  10. package/content/guidance/b2c-cli/b2c-cip/SKILL.md +3 -3
  11. package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +1 -1
  12. package/content/guidance/b2c-cli/b2c-config/SKILL.md +31 -21
  13. package/content/guidance/b2c-cli/b2c-content/SKILL.md +1 -1
  14. package/content/guidance/b2c-cli/b2c-debug/SKILL.md +1 -1
  15. package/content/guidance/b2c-cli/b2c-docs/SKILL.md +23 -2
  16. package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
  17. package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
  18. package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +1 -1
  19. package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +3 -3
  20. package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +1 -1
  21. package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +1 -1
  22. package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +1 -1
  23. package/content/guidance/b2c-cli/b2c-sites/SKILL.md +1 -1
  24. package/content/guidance/b2c-cli/b2c-slas/SKILL.md +1 -1
  25. package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +2 -2
  26. package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +2 -2
  27. package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +1 -1
  28. package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +2 -2
  29. package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +4 -4
  30. package/content/guidance/index.json +935 -258
  31. package/content/guidance/mcp/{cip → b2c-mcp-cip}/SKILL.md +10 -8
  32. package/content/guidance/mcp/{b2c-config → b2c-mcp-config}/SKILL.md +10 -9
  33. package/content/guidance/mcp/{debugger → b2c-mcp-debugger}/SKILL.md +9 -8
  34. package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/SKILL.md +81 -10
  35. package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +49 -25
  36. package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
  37. package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
  38. package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
  39. package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  40. package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +86 -79
  41. package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
  42. package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  43. package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
  44. package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  45. package/content/guidance/storefront-next/sfnext-components/SKILL.md +98 -136
  46. package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  47. package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  48. package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
  49. package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  50. package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  51. package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +116 -113
  52. package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  53. package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  54. package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +100 -150
  55. package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
  56. package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  57. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
  58. package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
  59. package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +83 -97
  60. package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
  61. package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +73 -97
  62. package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  63. package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +47 -44
  64. package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  65. package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
  66. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +59 -114
  67. package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
  68. package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +96 -131
  69. package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
  70. package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
  71. package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +152 -131
  72. package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  73. package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
  74. package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
  75. package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  76. package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  77. package/content/guidance/storefront-next/sfnext-performance/SKILL.md +75 -105
  78. package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  79. package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  80. package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +103 -116
  81. package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
  82. package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
  83. package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  84. package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
  85. package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  86. package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
  87. package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  88. package/content/guidance/storefront-next/sfnext-routing/SKILL.md +86 -143
  89. package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
  90. package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  91. package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
  92. package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  93. package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
  94. package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  95. package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
  96. package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
  97. package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  98. package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
  99. package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +80 -89
  100. package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
  101. package/content/guidance/storefront-next/sfnext-testing/SKILL.md +105 -138
  102. package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
  103. package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
  104. package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  105. package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
  106. package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  107. package/dist/commands/mcp.d.ts +8 -2
  108. package/dist/commands/mcp.js +54 -20
  109. package/dist/guidance.d.ts +4 -1
  110. package/dist/guidance.js +23 -5
  111. package/dist/registry.d.ts +2 -1
  112. package/dist/registry.js +3 -3
  113. package/dist/server.d.ts +10 -0
  114. package/dist/server.js +21 -0
  115. package/dist/skill-references.js +5 -5
  116. package/dist/tools/cartridges/index.js +1 -0
  117. package/dist/tools/cip/index.js +6 -3
  118. package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
  119. package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
  120. package/dist/tools/diagnostics/debug-start-session.js +1 -1
  121. package/dist/tools/scapi/index.d.ts +4 -1
  122. package/dist/tools/scapi/index.js +4 -2
  123. package/dist/tools/scapi/scapi-code.d.ts +2 -2
  124. package/dist/tools/scapi/scapi-code.js +17 -61
  125. package/dist/utils/types.d.ts +6 -0
  126. package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +20 -0
  127. package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
  128. package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
  129. package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
  130. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
  131. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
  132. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
  133. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
  134. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
  135. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
  136. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
  137. package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
  138. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
  139. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
  140. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
  141. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
  142. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +31 -21
  143. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
  144. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
  145. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
  146. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
  147. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
  148. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
  149. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
  150. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
  151. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +1 -1
  152. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
  153. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
  154. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
  155. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
  156. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
  157. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
  158. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +2 -2
  159. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
  160. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
  161. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +4 -4
  162. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
  163. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
  164. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
  165. package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
  166. package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
  167. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
  168. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
  169. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
  170. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
  171. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
  172. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
  173. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
  174. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
  175. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
  176. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
  177. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
  178. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
  179. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
  180. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
  181. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
  182. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
  183. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
  184. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
  185. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
  186. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
  187. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
  188. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
  189. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
  190. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
  191. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
  192. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
  193. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
  194. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
  195. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
  196. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
  197. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
  198. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
  199. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
  200. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
  201. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
  202. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
  203. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
  204. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
  205. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
  206. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
  207. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
  208. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
  209. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
  210. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
  211. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
  212. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
  213. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
  214. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
  215. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
  216. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
  217. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
  218. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
  219. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
  220. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
  221. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
  222. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
  223. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
  224. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
  225. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
  226. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
  227. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
  228. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
  229. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
  230. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
  231. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
  232. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
  233. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
  234. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
  235. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
  236. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
  237. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
  238. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
  239. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
  240. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
  241. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
  242. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
  243. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
  244. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
  245. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
  246. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
  247. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
  248. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
  249. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
  250. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
  251. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
  252. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
  253. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
  254. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
  255. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
  256. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
  257. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
  258. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
  259. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
  260. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
  261. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
  262. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
  263. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
  264. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
  265. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
  266. package/oclif.manifest.json +21 -4
  267. package/package.json +3 -3
  268. package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
  269. package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  270. package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  271. package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  272. package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  273. package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
  274. package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  275. package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  276. package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  277. package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  278. package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
  279. package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  280. package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  281. package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  282. package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
  283. package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  284. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
  285. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
  286. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
  287. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
  288. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
  289. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
  290. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
  291. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
  292. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
  293. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
  294. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
  295. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
  296. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
  297. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
  298. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
  299. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
  300. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
  301. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
  302. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
  303. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
  304. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
  305. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
  306. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/jobs.md +0 -0
  307. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
  308. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
  309. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
  310. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
  311. /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
  312. /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
@@ -0,0 +1,49 @@
1
+ # Writing a custom engagement adapter
2
+
3
+ Verify the types in `src/lib/adapters/engagement/types.ts` in your project first.
4
+
5
+ ## 1. Implement
6
+
7
+ ```ts
8
+ // src/lib/adapters/engagement/my-adapter.ts
9
+ import { hasConsent, type EngagementAdapter, type EngagementAdapterConfig } from '@/lib/adapters';
10
+ import type { AnalyticsEvent, ConsentPreferences, EventSiteInfo } from '@salesforce/storefront-next-runtime/events';
11
+
12
+ export function createMyAdapter(config: EngagementAdapterConfig): EngagementAdapter {
13
+ return {
14
+ name: 'my-adapter',
15
+ sendEvent: async (event: AnalyticsEvent, siteInfo?: EventSiteInfo, consentPreferences?: ConsentPreferences) => {
16
+ if (!hasConsent(config.consentCategory, consentPreferences)) return;
17
+ if (!config.eventToggles[event.eventType]) return;
18
+ navigator.sendBeacon('https://example.com/collect', JSON.stringify({ event, siteInfo }));
19
+ },
20
+ };
21
+ }
22
+ ```
23
+
24
+ `hasConsent(category, prefs)` is in `src/lib/adapters/engagement/utils.ts`; read it for the behavior when `category` is undefined.
25
+
26
+ ## 2. Register
27
+
28
+ In `src/lib/adapters/engagement/register.ts`, inside `initializeEngagementAdapters(appConfig)`:
29
+
30
+ ```ts
31
+ const mine = appConfig?.engagement?.adapters?.myAdapter;
32
+ if (mine?.enabled) {
33
+ addAdapter('my-adapter', createMyAdapter({ consentCategory: mine.consentCategory, eventToggles: mine.eventToggles || {}, ...mine }));
34
+ }
35
+ ```
36
+
37
+ Follow the try/catch and logger pattern used for the built-in adapters.
38
+
39
+ ## 3. Configure
40
+
41
+ Add `engagement.adapters.myAdapter: { enabled: true, consentCategory: 'marketing', eventToggles: { view_page: true } }` in `config.server.ts`. Add `'marketing'` (or your category) to `trackingConsent.consentCategories`.
42
+
43
+ ## 4. Allow the endpoint in CSP
44
+
45
+ Beacons to a new host need `connect-src` (and script hosts need `script-src`). See `storefront-next:sfnext-security`.
46
+
47
+ ## 5. Test
48
+
49
+ Unit-test the adapter with and without consent (see the `*.test.ts` files beside the built-in adapters for the pattern).
@@ -1,120 +1,127 @@
1
1
  ---
2
2
  name: sfnext-authentication
3
- description: Implement authentication in Storefront Next using split-cookie architecture, SLAS tokens, and auth middleware. Use when accessing user identity in loaders, detecting guest vs registered users, using getAuth or useAuth, or understanding session management and token refresh.
3
+ description: >-
4
+ Work with Storefront Next's server-only authentication and session architecture (SLAS guest/registered tokens, httpOnly cookies, auth.server.ts middleware). Use for getAuth, useAuth, updateAuth, destroyAuth, protecting account routes, login/logout actions, guest-to-registered basket/wishlist merge, "session expired" redirects, 401 recovery loops, cc-at/cc-nx/usid/dwsid cookies, cookie names or expiry, passwordless login, social login, OTP email verification, passkeys, guest order lookup, or refresh-token lifetime settings. Do not use for Turnstile, CSP headers or cookie-domain config (use `storefront-next:sfnext-security`), calling SCAPI clients (use `storefront-next:sfnext-scapi`), or sharing sessions with SFRA (use `storefront-next:sfnext-hybrid-storefronts`).
4
5
  ---
5
6
 
6
- # Authentication Skill
7
+ # Storefront Next Authentication
7
8
 
8
- This skill covers Storefront Next's split-cookie authentication architecture with SLAS (Shopper Login and API Access Service).
9
+ Authentication is **server-only**. One middleware (`src/middlewares/auth.server.ts`, registered in the `middleware` array of `src/root.tsx`) runs on every request: it reads cookies, validates or refreshes the SLAS access token, performs a guest login when nothing usable exists, and writes `Set-Cookie`. Tokens never reach the browser. Components only see a small non-sensitive slice through `useAuth()`.
9
10
 
10
- ## Overview
11
+ Read `docs/README-AUTH.md` in your project for the full reference; this skill is the task-oriented summary. Route modules use server `loader`/`action` only, never `clientLoader`/`clientAction`.
11
12
 
12
- Storefront Next uses a split-cookie architecture separating server and client auth concerns:
13
+ ## Request flow
13
14
 
14
- - **Server middleware** (`auth.server.ts`) — Manages SLAS tokens, writes cookies, handles token refresh
15
- - **React Context** (`AuthProvider`) — Provides public session data (non-sensitive fields) to components via `useAuth()`
15
+ 1. Valid access token (JWT `exp` in the future): use it.
16
+ 2. Expired access token with a refresh token: refresh, rewrite `cc-at`.
17
+ 3. No tokens: guest login.
18
+ 4. Registered shopper whose refresh fails: 307 to `/login?returnUrl=<path>&error=session_expired` (site/locale prefix included) and a fresh guest session is created in parallel. Guests are silently re-issued a guest session.
19
+ 5. A SCAPI call returning 401 throws `AuthTokenInvalidError`; the middleware clears state, re-runs login/refresh and 307-redirects to the same URL. The short-lived `cc-auth-recover` cookie (30 s) prevents loops.
16
20
 
17
- ## Cookie Design
21
+ User type comes from the access-token JWT (registered tokens carry an `rcid` claim), not from which cookie exists. `customerId` is **not** a cookie; it is derived per request from the JWT.
18
22
 
19
- | Cookie | Purpose | User Type | Expiry | HttpOnly |
20
- |--------|---------|-----------|--------|----------|
21
- | `cc-nx-g` | Guest refresh token | Guest | 30 days | No |
22
- | `cc-nx` | Registered refresh token | Registered | 90 days | No |
23
- | `cc-at` | Access token | Both | 30 min | No |
24
- | `usid` | User session ID | Both | Matches refresh | No |
25
- | `customerId` | Customer ID | Registered | Matches refresh | No |
26
-
27
- **Key points:**
28
- - Only ONE refresh token exists at a time (guest OR registered, never both)
29
- - User type is derived from which refresh token is present
30
- - Cookies are auto-namespaced with `siteId`
31
- - Tokens auto-refresh when expired
32
-
33
- ## Usage in Loaders/Actions
23
+ ## Read auth on the server
34
24
 
35
25
  ```typescript
36
26
  import { getAuth } from '@/middlewares/auth.server';
27
+ import type { LoaderFunctionArgs } from 'react-router';
37
28
 
38
- export function loader({ context }: LoaderFunctionArgs) {
39
- const auth = getAuth(context);
40
-
41
- const { accessToken, customerId, userType } = auth;
42
- const isGuest = userType === 'guest';
43
- const isRegistered = userType === 'registered';
44
-
45
- return { isGuest, customerId };
29
+ export async function loader({ context }: LoaderFunctionArgs) {
30
+ const auth = getAuth(context); // full SessionData, server only
31
+ const isRegistered = auth.userType === 'registered';
32
+ return { isRegistered }; // never return auth.accessToken / refreshToken
46
33
  }
47
34
  ```
48
35
 
49
- ## Usage in Components
36
+ ## Read auth in components
50
37
 
51
- ```typescript
38
+ ```tsx
52
39
  import { useAuth } from '@/providers/auth';
53
40
 
54
- export function MyComponent() {
55
- const auth = useAuth();
56
-
57
- if (auth?.userType === 'guest') {
58
- return <LoginPrompt />;
59
- }
60
-
61
- return <div>Welcome, customer {auth?.customerId}</div>;
41
+ function AccountBadge() {
42
+ const auth = useAuth(); // PublicSessionData | undefined
43
+ return auth?.userType === 'registered' ? <span>Welcome back</span> : <SignInLink />;
62
44
  }
63
45
  ```
64
46
 
65
- ## Common Patterns
47
+ `PublicSessionData` is exactly `customerId`, `userType`, `usid`, `encUserId`, `trackingConsent`. The root loader derives it with `getPublicSessionData` (from `@/middlewares/auth.utils`) and passes it to `AuthProvider`; there is no client `getAuth`.
48
+
49
+ ## Protect a route
66
50
 
67
- ### Protected Routes
51
+ Branch inside the server loader. Prefer the existing account layout (`src/routes/_app.account.tsx`) for anything under `/account` instead of adding per-route checks.
68
52
 
69
53
  ```typescript
70
- export function loader({ context }: LoaderFunctionArgs) {
71
- const auth = getAuth(context);
54
+ import { redirect } from 'react-router';
55
+ import { getAuth } from '@/middlewares/auth.server';
56
+ import { buildUrlFromContext } from '@/lib/url.server';
57
+ import { routes } from '@/route-paths';
72
58
 
73
- if (auth.userType === 'guest') {
74
- throw redirect('/login');
59
+ export async function loader({ context }: LoaderFunctionArgs) {
60
+ if (getAuth(context).userType !== 'registered') {
61
+ throw redirect(buildUrlFromContext(routes.login, context)); // keeps site/locale prefix
75
62
  }
76
-
77
- const clients = createApiClients(context);
78
- return {
79
- orders: clients.shopperOrders.getOrders({
80
- params: { path: { customerId: auth.customerId } }
81
- }).then(({ data }) => data),
82
- };
63
+ // ...
83
64
  }
84
65
  ```
85
66
 
86
- ### Conditional Data Loading
67
+ ## Log in and out
68
+
69
+ Never write auth cookies yourself. Use the helpers exported from `@/middlewares/auth.server`:
87
70
 
88
71
  ```typescript
89
- export function loader({ context }: LoaderFunctionArgs) {
90
- const auth = getAuth(context);
91
- const clients = createApiClients(context);
92
-
93
- const base = {
94
- products: clients.shopperProducts.getProducts({...}).then(({ data }) => data),
95
- };
96
-
97
- if (auth.userType === 'registered') {
98
- return {
99
- ...base,
100
- wishlist: clients.shopperCustomers.getWishlist({...}).then(({ data }) => data),
101
- };
102
- }
72
+ import { loginRegisteredUser, updateAuth } from '@/middlewares/auth.server';
103
73
 
104
- return base;
74
+ export async function action({ request, context }: ActionFunctionArgs) {
75
+ const form = await request.formData();
76
+ const tokens = await loginRegisteredUser(context, String(form.get('email')), String(form.get('password')));
77
+ updateAuth(context, tokens); // re-derives userType/customerId/usid, swaps cc-nx-g for cc-nx
78
+ return redirect('/account');
105
79
  }
106
80
  ```
107
81
 
108
- ## Troubleshooting
82
+ `updateAuth` accepts a SLAS token response or an updater function (`updateAuth(context, (cur) => ({ ...cur, codeVerifier }))`). Logout: `destroyAuth(context)` clears every auth cookie on the response; the shipped `src/routes/_empty.logout.ts` also calls `clients.auth.logout` and `destroyBasket`. Prefer `src/lib/api/auth/standard-login.server.ts` and `social-login.server.ts` over hand-rolled flows: they already handle the merge below.
83
+
84
+ Other exported helpers: `loginGuestUser`, `refreshAccessToken`, `authorizePasswordless`, `getPasswordLessAccessToken`, `getPasswordResetToken`, `resetPasswordWithToken`, `requestOtp`, `verifyOtp`, `flashAuth(context, message)` (clear session plus an error message), `clearInvalidSessionAndRestoreGuest(context)` (deleted customer or corrupted session).
85
+
86
+ ## Guest to registered merge
87
+
88
+ `customerId` changes from the guest `gcid` to the registered `rcid` at the token swap, and SCAPI rejects the guest id under the registered token. So: snapshot guest-owned data (wishlist) **before** the swap, then `mergeBasket` and `mergeWishlist` **after**. `src/lib/api/auth/social-login.server.ts` is the reference implementation. `dw_dnt` tracking consent is preserved across the swap.
89
+
90
+ ## Common SCAPI calls for account data
91
+
92
+ These are real operations: `clients.shopperCustomers.getCustomerOrders`, `getCustomerProductLists` (wishlists), `getCustomer`. Use the existing helpers (`src/lib/api/order.server.ts`, `wishlist.server.ts`, `customer.server.ts`) rather than calling clients directly. Client setup and the `@/lib/api-clients.server` import are covered in `storefront-next:sfnext-scapi`.
93
+
94
+ ## Configuration
95
+
96
+ | Setting | Where |
97
+ |---|---|
98
+ | Refresh-token lifetime | `PUBLIC_COMMERCE_API_GUEST_REFRESH_TOKEN_EXPIRY_SECONDS` (max 30 days), `PUBLIC_COMMERCE_API_REGISTERED_REFRESH_TOKEN_EXPIRY_SECONDS` (max 90 days) |
99
+ | Feature flags | `features.passwordlessLogin`, `features.passkey`, `features.socialLogin`, `features.otpRequest`, `auth.otpLength` in `config.server.ts` |
100
+ | Private SLAS client | `commerce.api.privateKeyEnabled` (required for passwordless / OTP) |
101
+ | Cookie domain | `app.cookies.domain` (see `storefront-next:sfnext-security`) |
102
+
103
+ `secure` on cookies is only set on deployed (HTTPS) environments; local `pnpm dev` over `http://localhost` writes non-secure cookies so Safari keeps them.
104
+
105
+ ## Pitfalls
106
+
107
+ - Reading tokens with `document.cookie`: impossible by design (httpOnly). Use `useAuth()` or loader data.
108
+ - Returning `getAuth(context)` from a loader leaks tokens into the page. Return only derived values.
109
+ - Refreshing tokens manually in routes: the middleware already does it.
110
+ - Logging `accessToken` or `refreshToken`: never.
111
+ - Changing the cookie domain on a live site leaves old host-only cookies shadowing new ones; roll out in a quiet window.
112
+ - A loop of redirects to `/login?error=session_expired` usually means refresh tokens are being rejected (SLAS client config, or cookie domain mismatch between hosts).
113
+
114
+ ## References
109
115
 
110
- | Issue | Cause | Solution |
111
- |-------|-------|----------|
112
- | `auth` is undefined | Missing auth middleware | Ensure `auth.server.ts` middleware is configured |
113
- | Always guest | Refresh token expired | Check cookie expiry; SLAS auto-refreshes |
114
- | Token errors in SCAPI | Stale access token | Tokens auto-refresh; check SLAS client configuration |
116
+ - [COOKIES.md](references/COOKIES.md): full cookie inventory, namespacing, expiry, hints.
117
+ - [LOGIN-FLOWS.md](references/LOGIN-FLOWS.md): passwordless, social, OTP, passkeys, password reset, guest order lookup, email cartridge prerequisites.
118
+ - In your project: `docs/README-AUTH.md`, `docs/README-EMAIL-VERIFICATION.md`, `docs/README-GUEST-ORDER-LOOKUP.md`, `docs/README-EMAIL-CARTRIDGE.md`.
115
119
 
116
120
  ## Related Skills
117
121
 
118
- - `storefront-next:sfnext-data-fetching` - Using auth context in loader functions
119
- - `storefront-next:sfnext-configuration` - SLAS client configuration
120
- - `storefront-next:sfnext-hybrid-storefronts` - Session bridging with SFRA
122
+ - `storefront-next:sfnext-security` - Turnstile bot protection, CSP for social providers, cookie domain
123
+ - `storefront-next:sfnext-scapi` - SCAPI clients and custom APIs
124
+ - `storefront-next:sfnext-hybrid-storefronts` - shared `dwsid` session bridge with SFRA
125
+ - `storefront-next:sfnext-analytics-consent` - `dw_dnt` tracking consent
126
+ - `storefront-next:sfnext-configuration` - `config.server.ts` and `PUBLIC__` overrides
127
+ - `b2c-cli:b2c-slas` - manage SLAS clients and scopes
@@ -0,0 +1,39 @@
1
+ # Storefront Next Auth Cookies
2
+
3
+ Source of truth in your project: `docs/README-AUTH.md` (Cookie Architecture) and the constants in `src/middlewares/auth.utils.ts`. Cookie serialization lives in `src/lib/cookie-utils.server.ts` (`getCookieConfig`, `createCookie`).
4
+
5
+ All auth cookies are `HttpOnly`, so client JavaScript cannot read them. The only exception is `dw_dnt` (the consent banner reads it). The browser still sends every cookie on each request, which is what lets the server middleware and a hybrid B2C Commerce (SFRA) storefront read them.
6
+
7
+ | Cookie | Purpose | User type | Lifetime | Notes |
8
+ |---|---|---|---|---|
9
+ | `cc-nx-g` | Guest refresh token | Guest | Guest refresh expiry (max 30 days) | Mutually exclusive with `cc-nx` |
10
+ | `cc-nx` | Registered refresh token | Registered | Registered refresh expiry (max 90 days) | Written on login; deletes `cc-nx-g` |
11
+ | `cc-at` | Access token | Both | JWT `exp` | Refreshed by middleware |
12
+ | `usid` | SLAS user session id (JWT `sub`) | Both | Refresh expiry, else access expiry | Keep httpOnly; never expose to JS |
13
+ | `enc_user_id` | Encoded user id | Registered | Refresh expiry | Needed for some SLAS calls |
14
+ | `idp_access_token` | Social-login IDP access token | Both | Access expiry | Social login only |
15
+ | `id_token` | OIDC ID token | Both | Access expiry | |
16
+ | `idp_refresh_token` | Social-login IDP refresh token | Both | Refresh expiry | |
17
+ | `dw_dnt` | Tracking consent (value is the `TrackingConsent` enum) | Both | Session | Not httpOnly, not site-namespaced; cookie is the source of truth |
18
+ | `dwsid` | B2C Commerce session id (hybrid bridge) | Both | Session | Not site-namespaced; taken from the SLAS `Set-Cookie` header |
19
+ | `cc-cv` | PKCE code verifier | Both | 5 minutes | Social login flow |
20
+ | `cc-auth-recover` | 401 / session-expiry redirect loop guard | Both | 30 seconds | Set by middleware, cleared on follow-up request |
21
+
22
+ Related non-auth cookies you may see: `cc-tv_<siteId>` (Turnstile attestation, 30 min, see `storefront-next:sfnext-security`), `glo_order_*` / `glo_cd_*` (guest order lookup), site-context cookies for site, locale and currency, a JS-readable `__sfdc_usertype_<siteId>` hint that carries only guest/registered so cached app-shell HTML can restore header state, and a JS-readable basket snapshot cookie. The hint and basket cookies never carry tokens.
23
+
24
+ ## Rules
25
+
26
+ - **Namespacing.** Cookies are suffixed with the site id (for example `cc-nx_RefArch`) so multi-site deployments do not collide. `dwsid` and `dw_dnt` are deliberately excluded (`COOKIE_NAMESPACE_EXCLUSIONS`) so B2C Commerce and external scripts can read them.
27
+ - **No `userType` cookie.** It is derived from the access-token JWT (`rcid` claim means registered). The refresh-cookie name is only a cold-start fallback and a write-time decision about which refresh cookie to set or delete.
28
+ - **No `customerId` cookie.** Derived from the JWT. A legacy `customer_id` cookie is only deleted on logout and error paths.
29
+ - **Value source.** Token strings come from the SLAS token response body; `userType`, `customerId`, `usid`, expiry and consent are decoded from the JWT so they cannot drift from the token. `dwsid` is the exception (SLAS `Set-Cookie`).
30
+ - **Expiry overrides.** `PUBLIC_COMMERCE_API_GUEST_REFRESH_TOKEN_EXPIRY_SECONDS` and `PUBLIC_COMMERCE_API_REGISTERED_REFRESH_TOKEN_EXPIRY_SECONDS` can shorten the refresh lifetime; values above 30 / 90 days are capped.
31
+ - **Defaults.** `path: '/'`, `sameSite: 'lax'`, `secure` only on deployed HTTPS (gated on `isRemote()`); `SameSite=None` cookies used by Page Designer design mode always stay `Secure`. The resolved `app.cookies.domain` (or per-site `commerce.sites[].cookies.domain`) applies to every cookie the storefront writes.
32
+ - **Never write auth cookies directly.** Use `updateAuth` / `destroyAuth`; the middleware owns serialization and deletes cookies with expired `Set-Cookie` headers.
33
+
34
+ ## Debugging checklist
35
+
36
+ 1. DevTools > Application > Cookies: do you see duplicates of the same name (host-only plus domain-scoped)? See cookie-domain rollout notes in `storefront-next:sfnext-security`.
37
+ 2. Login works but does not stick on Safari over `http://localhost`: `secure` cookies are refused; confirm you are on `pnpm dev`/`pnpm preview` (which write non-secure cookies) and not a tunnel or HTTPS proxy with mismatched host.
38
+ 3. Hybrid pages lose the session: confirm `dwsid` is present on both storefronts and the cookie-domain settings agree on both sides.
39
+ 4. Repeated `session_expired` redirects: check the SLAS client's refresh-token settings and that the cookie domain matches the serving host.
@@ -0,0 +1,59 @@
1
+ # Login Flows
2
+
3
+ All flows end in `updateAuth(context, tokenResponse)` from `@/middlewares/auth.server`. Prefer the existing route and library code over new implementations:
4
+
5
+ | Flow | Entry points in your project |
6
+ |---|---|
7
+ | Password login | `src/routes/_empty.login.tsx`, `src/lib/api/auth/standard-login.server.ts` |
8
+ | Registration | `src/routes/_empty.signup.tsx`, `src/lib/api/auth/register.server.ts` |
9
+ | Password reset | `src/routes/_empty.reset-password.tsx`, `action.request-password-reset.ts`, `resource.slas-reset-password-callback.ts`, `src/lib/api/auth/reset-password.server.ts` |
10
+ | Passwordless / OTP | `action.authorize-passwordless-email.ts`, `action.verify-passwordless-otp.ts`, `action.otp-request.ts`, `action.otp-verify.ts`, `resource.slas-passwordless-login-callback.ts`, `src/lib/auth/passwordless-login.server.ts` |
11
+ | Social login | `src/lib/api/auth/social-login.server.ts` |
12
+ | Passkeys | `action.passkey-*.ts`, `resource.passkey-status.ts`, `_app.account.passkeys.tsx`, `src/components/passkeys/`, `src/lib/auth/passkey-support.ts`, `webauthn.ts` |
13
+ | Guest order lookup | `_app.order-lookup.*`, `action.order-lookup-*.ts`, `src/lib/order/` |
14
+
15
+ Auth helpers used by these flows (`authorizePasswordless`, `getPasswordLessAccessToken`, `requestOtp`, `verifyOtp`, `getPasswordResetToken`, `resetPasswordWithToken`, passkey start/finish functions) are exported from `@/middlewares/auth.server`.
16
+
17
+ ## Passwordless (magic link) and OTP
18
+
19
+ - Enable in `config.server.ts` under `features.passwordlessLogin` (`enabled`, `mode: 'email' | 'callback'`, `callbackUri` default `/passwordless-login-callback`, `landingUri` default `/login`). The callback URL must be allowlisted in the SLAS client. The callback route takes no site/locale prefix so one SLAS entry covers all sites.
20
+ - Requires a SLAS **private** client: set `commerce.api.privateKeyEnabled: true`. If it is `false`, passwordless is disabled at runtime regardless of other settings.
21
+ - `features.otpRequest.mode`: `email` (SLAS sends the code; supports email verification) or `callback` (SLAS POSTs the code to your `callbackUri` and you deliver it; no email-verification UI). `auth.otpLength` must be 6 or 8 and match the SLAS client.
22
+ - Email verification UI (verified badge, change email, passwordless registration) turns on with the Business Manager preference **Enable Email Verification** (Site Preferences > Storefront Login Preferences; up to 5 minutes to propagate). Changing login email also needs **Enable Loginid Updates for SCAPI** (request via Salesforce support) and B2C 24.7 or later.
23
+ - Full detail and troubleshooting table: `docs/README-EMAIL-VERIFICATION.md`.
24
+
25
+ ## Email delivery (email cartridge)
26
+
27
+ Magic links, password resets and OTPs are sent by the `app_storefrontnext_base` cartridge's `POST /notify` custom API, called server-side via `clients.sfnextNotify` (`src/lib/notify/notify.server.ts`). One-time setup:
28
+
29
+ 1. `sfnext setup-base-cartridge --slas-client-id <id>` registers the `c_sfnext_notify` scope on the SLAS client (idempotent; needs `SFCC_SHORTCODE`, `SFCC_TENANT_ID` and OAuth client credentials).
30
+ 2. Deploy the cartridge (`pnpm cartridge:deploy --reload`) and add `app_storefrontnext_base` to the site cartridge path.
31
+ 3. Complete the Business Manager steps in `docs/README-EMAIL-CARTRIDGE.md` (storefront host allowlist preference, etc.).
32
+
33
+ To change how mail is sent, customize the cartridge's `sendNotification` helper rather than the storefront. Deploy and endpoint registration checks: `b2c-cli:b2c-code`, `b2c-cli:b2c-scapi-custom`.
34
+
35
+ ## Social login
36
+
37
+ - Enable `features.socialLogin` (`enabled`, `providers`, `callbackUri` default `/social-callback`). Each provider also needs setup in Account Manager / SLAS.
38
+ - Flow is authorization-code with PKCE: generate the challenge, store the verifier via `updateAuth(context, (cur) => ({ ...cur, codeVerifier }))` (lands in httpOnly `cc-cv`, 5 minutes), redirect to the IDP, exchange the code in the callback and call `updateAuth(context, tokenResponse)`.
39
+ - Adding a provider beyond the defaults usually needs CSP changes (`connect-src`, redirect/popup origins): see `storefront-next:sfnext-security`.
40
+ - Guest wishlist/basket must be captured before and merged after the token swap; copy the shape of `social-login.server.ts`.
41
+ - In a hybrid setup add `^/social-callback.*` to `HYBRID_ROUTING_RULES` (see `storefront-next:sfnext-hybrid-storefronts`).
42
+
43
+ ## Passkeys
44
+
45
+ Enable with `features.passkey.enabled`. Registration is authorized by an OTP whose delivery follows `features.passkey.mode` (`email` or `callback`, same allowlisting rules as above). Passkeys are managed on `/account/passkeys`.
46
+
47
+ ## Guest order lookup
48
+
49
+ Lets a guest find an order by order number plus email, confirm a 6-digit access code (valid 15 minutes, fixed by SCAPI) and view a redacted read-only order.
50
+
51
+ - Set `guestOrderLookup.enabled: true` (default `false`). When off, both pages 404 and the actions return `FEATURE_DISABLED`.
52
+ - Set `GUEST_ORDER_LOOKUP_COOKIE_SECRET` (falls back to `CLIENT_SECRET`); without a secret the feature fails closed with `CONFIGURATION_ERROR`.
53
+ - Implement the B2C Commerce hook `sfcc.app.order.sendOrderAccessCode(order, accessCode)` in a cartridge; the storefront never sends this email itself (the shipped email cartridge covers it).
54
+ - `guestOrderLookup.allowedFields` is an allow-list applied to the order before it reaches the browser; `cooldownSeconds` and `orderNumberPattern` tune abuse controls. Turnstile is enforced on the request-code step only (`guestOrderLookup.turnstile`).
55
+ - Full detail: `docs/README-GUEST-ORDER-LOOKUP.md`.
56
+
57
+ ## Bot protection on login
58
+
59
+ The passwordless/OTP email step, checkout registration and order lookup can be gated with Cloudflare Turnstile. Configuration and rollout are in `storefront-next:sfnext-security`.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: sfnext-commerce-features
3
+ description: >-
4
+ Catalogue and router for optional Storefront Next commerce features: Shopper Context (qualifiers, source codes), Order Management returns/cancel/tracking (SOM/OMS), delivery estimates, feature stubs (@feature-stub), guest order lookup, the app_storefrontnext_base email cartridge, and the shipped extensions (bnpl, bopis, multiship, store-locator, ratings-reviews, customer-preferences, product-content, shipping-delivery, theme-switcher). For each: which flag, SLAS scope, Business Manager setting, cartridge, or extension registry entry it needs, and which in-project doc to read. Use when asked how to enable a feature, why a feature does not render, what prerequisites a feature has, or which stubs are mock data. Do not use for building a new extension (use `storefront-next:sfnext-extensions`), config loading (use `storefront-next:sfnext-configuration`), or SLAS login flows (use `storefront-next:sfnext-authentication`).
5
+ ---
6
+
7
+ # Storefront Next Commerce Features
8
+
9
+ Start with the feature table, then read the named doc in your project's `docs/` folder. Do not assume a feature is live: several ship as UI scaffolds with mock data (see Feature stubs).
10
+
11
+ ## Feature table
12
+
13
+ | Feature | Enable with | Also needs | Read |
14
+ |---|---|---|---|
15
+ | Shopper Context | `features.shopperContext.enabled` (env: `PUBLIC__app__features__shopperContext__enabled=true`), default off | Shopper Context API access for the SLAS client; qualifiers arrive as URL params or via the `useShopperContext` hook, stored in cookies | `docs/README-SHOPPER-CONTEXT.md` |
16
+ | Returns, cancel, tracking (Order Management) | Nothing to toggle | Salesforce Order Management connected to the B2C instance; order loader expands `['oms','oms_shipments']`; without `omsData` only tracking shows | `docs/README-ORDER-MANAGEMENT.md` |
17
+ | Delivery estimates | Keep extension `SFDC_EXT_SHIPPING_DELIVERY` installed | SLAS scopes `sfcc.shopper-delivery-estimates` and `sfcc.shopper-standard`, a delivery-estimate Commerce App bound to `sfcc.app.shipping.estimate`, online products on the site | `docs/README-DELIVERY-ESTIMATES.md` |
18
+ | Guest order lookup | `guestOrderLookup.enabled: true` in `config.server.ts` | `GUEST_ORDER_LOOKUP_COOKIE_SECRET` (or `CLIENT_SECRET` fallback) and a cartridge implementing hook `sfcc.app.order.sendOrderAccessCode` to email the code | `docs/README-GUEST-ORDER-LOOKUP.md` |
19
+ | Email cartridge (`app_storefrontnext_base`) | Deploy cartridge, add to site cartridge path | SLAS scope `c_sfnext_notify` (`sfnext setup-base-cartridge --slas-client-id <id>`), import preference metadata, set `Storefront Hosts` global custom preference, callback mode in storefront config | `docs/README-EMAIL-CARTRIDGE.md` |
20
+ | Feature stubs | n/a | Mock UI scaffolds, not integrations | `docs/README-FEATURE-STUBS.md` |
21
+
22
+ ## Extensions shipped in src/extensions
23
+
24
+ Registry: `src/extensions/config.json` (keys `SFDC_EXT_*`). Each extension contributes components to `UITarget` points through its `target-config.json`. To install or remove one, follow the install/uninstall instructions in `instructions/*.mdc` when the registry entry references them; building new extensions is `storefront-next:sfnext-extensions`.
25
+
26
+ | Extension | Registry key | Notes |
27
+ |---|---|---|
28
+ | Store Locator | `SFDC_EXT_STORE_LOCATOR` | Find stores by location. Guided install/uninstall in `instructions/`. |
29
+ | Multiship | `SFDC_EXT_MULTISHIP` | Ship items to several addresses in one order. Guided install/uninstall. |
30
+ | Buy Online Pickup In Store | `SFDC_EXT_BOPIS` | Depends on Store Locator and Multiship. Guided install/uninstall. |
31
+ | Shipping and Delivery | `SFDC_EXT_SHIPPING_DELIVERY` | Registers `sfcc.pdp.estimatedDelivery`; see delivery estimates row. |
32
+ | Buy Now Pay Later (demo) | `SFDC_EXT_BNPL` | Mock fixtures; `sfcc.pdp.bnpl.message` target. Replace API function bodies to integrate a provider. |
33
+ | Ratings and Reviews (demo) | `SFDC_EXT_RATINGS_REVIEWS` | Mock fixtures for PDP, cart modal, order detail CTA. Integrate Bazaarvoice, PowerReviews, etc. by replacing API bodies. |
34
+ | Product Content (demo) | `SFDC_EXT_PRODUCT_CONTENT` | Returns/warranty card, FAQ, collapsibles (`sfcc.pdp.returnsWarranty`, `sfcc.pdp.faq`, `sfcc.pdp.collapsibles`). Fixtures in `lib/api/product-content.server.ts`. |
35
+ | Customer Preferences (demo) | `SFDC_EXT_CUSTOMER_PREFERENCES` | Interests/preferences on the account page. Mock data. |
36
+ | Theme switcher | none in registry | Folder `src/extensions/theme-switcher` has no registry entry in the shipped project; check your project before relying on it. |
37
+
38
+ Demo extensions are "(Demo)" in `config.json`. Treat them as reference implementations: read the extension `README.md` and replace fixture functions before go-live.
39
+
40
+ ## Feature stubs
41
+
42
+ Working UI with no backend (express checkout buttons, BNPL, returns and warranty, customer interests, and others). Find all of them:
43
+
44
+ ```bash
45
+ grep -r "@feature-stub" src/
46
+ ```
47
+
48
+ Each marker explains how to strip or wire it. Review the list before launch so mock content does not ship.
49
+
50
+ ## Decision flow when "the feature is not showing"
51
+
52
+ 1. Flag off? (`shopperContext`, `guestOrderLookup`) - check `config.server.ts` and env overrides.
53
+ 2. Extension missing from `src/extensions/config.json`, or dependencies not installed (BOPIS needs Store Locator and Multiship)?
54
+ 3. Missing SLAS scope on the shopper client (see `storefront-next:sfnext-authentication`)? Confirm in your SLAS client config, then re-login to get a fresh token.
55
+ 4. Backend not configured: OMS not connected, Commerce App not bound, cartridge not on the site cartridge path.
56
+ 5. Result is mock data: it is a stub.
57
+
58
+ More detail per group: [references/FEATURE-PREREQUISITES.md](references/FEATURE-PREREQUISITES.md).
59
+
60
+ ## Related Skills
61
+
62
+ - `storefront-next:sfnext-extensions` - UITarget, target-config.json, authoring extensions
63
+ - `storefront-next:sfnext-configuration` - feature flags and env overrides
64
+ - `storefront-next:sfnext-authentication` - SLAS scopes and clients
65
+ - `storefront-next:sfnext-scapi` - calling the backing SCAPI endpoints
66
+ - `storefront-next:sfnext-deployment` - deploying cartridges and bundles
67
+ - `b2c-cli:b2c-mrt` - Managed Runtime environment variables
@@ -0,0 +1,37 @@
1
+ # Feature prerequisites checklist
2
+
3
+ Verify each item in your project; these come from the shipped docs and config.
4
+
5
+ ## Shopper Context
6
+ - Flag: `features.shopperContext.enabled` (default false). When off, the middleware makes no SCAPI calls.
7
+ - Qualifiers come from URL query params (middleware) or `useShopperContext`; state persists in cookies and is sent to SCAPI as a full replace.
8
+ - Customizing supported qualifiers: `docs/README-SHOPPER-CONTEXT.md` "Customization".
9
+
10
+ ## Order Management
11
+ - No flag. Needs SOM connected; the order detail loader calls `shopperOrders.getOrder` with `expand: ['oms', 'oms_shipments']`.
12
+ - Return/cancel render only for registered, owning shoppers with item-level availability (`omsData.quantityAvailableToReturn > 0`).
13
+ - ECOM-only orders degrade to tracking.
14
+
15
+ ## Delivery estimates
16
+ - SLAS scopes: `sfcc.shopper-delivery-estimates`, `sfcc.shopper-standard`.
17
+ - Commerce App provider bound to `sfcc.app.shipping.estimate`.
18
+ - API `403`/`500` falls back to merchant shipping-method descriptions as general guidance only.
19
+ - Verify by requesting an estimate for a product and destination; troubleshooting section in the doc.
20
+
21
+ ## Guest order lookup
22
+ - Flag `guestOrderLookup.enabled`; keys include `orderNumberPattern`, `cooldownSeconds`, `allowedFields`.
23
+ - Cookie secret env var required or the feature fails closed.
24
+ - Access code lifetime is set by SCAPI, email is sent by your hook implementation.
25
+ - When disabled: page routes 404 and action routes return `FEATURE_DISABLED`.
26
+
27
+ ## Email cartridge
28
+ 1. `sfnext setup-base-cartridge --slas-client-id <id>` (idempotent; reads `SFCC_SHORTCODE`, `SFCC_TENANT_ID`, `SFCC_OAUTH_CLIENT_ID`, `SFCC_OAUTH_CLIENT_SECRET` or `dw.json`).
29
+ 2. Deploy: `pnpm cartridge:deploy` (script runs `sfnext deploy-cartridge`). The email-cartridge doc shows a different command spelling; prefer the script in your `package.json`.
30
+ 3. Add `app_storefrontnext_base` to the site cartridge path; import the preference metadata; set the `Storefront Hosts` preference to your MRT hostnames.
31
+ 4. Set callback mode and callback URIs in storefront config; register the matching URLs in SLAS.
32
+ Also see `storefront-next:sfnext-deployment`.
33
+
34
+ ## Extensions
35
+ - Registry entries list `dependencies` (BOPIS -> Store Locator, Multiship).
36
+ - Store Locator, Multiship, BOPIS ship install/uninstall `.mdc` instructions in `instructions/`. Additional BM or backend setup for them is not documented in a single place; check the instructions and each extension folder.
37
+ - Demo extensions use fixtures; replace the API function bodies before production.