@salesforce/b2c-dx-mcp 3.2.1 → 3.4.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.
- package/bin/run.js +5 -9
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +4 -4
- package/content/guidance/b2c/b2c-ordering/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +3 -3
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +6 -6
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +54 -25
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +23 -2
- package/content/guidance/b2c-cli/b2c-ecdn/SKILL.md +2 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/SKILL.md +9 -3
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +35 -6
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +6 -2
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +2 -2
- package/content/guidance/b2c-ops/b2c-edge-traffic-triage/SKILL.md +69 -0
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +13 -8
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +5 -4
- package/content/guidance/index.json +981 -259
- package/content/guidance/mcp/{cip → b2c-mcp-cip}/SKILL.md +10 -8
- package/content/guidance/mcp/{b2c-config → b2c-mcp-config}/SKILL.md +10 -9
- package/content/guidance/mcp/{debugger → b2c-mcp-debugger}/SKILL.md +9 -8
- package/content/guidance/mcp/b2c-mcp-scapi/SKILL.md +98 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/authentication.md +34 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/compose-verify.md +25 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/confirmation.md +30 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/discover.md +94 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/jobs.md +72 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/workflows.md +28 -0
- package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +52 -25
- package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
- package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +86 -79
- package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
- package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/content/guidance/storefront-next/sfnext-components/SKILL.md +98 -136
- package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
- package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +116 -113
- package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +100 -150
- package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +83 -97
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +73 -97
- package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +96 -131
- package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
- package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
- package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +152 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/content/guidance/storefront-next/sfnext-performance/SKILL.md +75 -105
- package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +103 -116
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
- package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/content/guidance/storefront-next/sfnext-routing/SKILL.md +86 -143
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
- package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
- package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
- package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
- package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +80 -89
- package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +105 -138
- package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
- package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/dist/commands/mcp.d.ts +8 -2
- package/dist/commands/mcp.js +54 -20
- package/dist/guidance.d.ts +4 -1
- package/dist/guidance.js +23 -5
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +3 -3
- package/dist/server.d.ts +10 -0
- package/dist/server.js +21 -0
- package/dist/skill-references.js +5 -5
- package/dist/tools/cartridges/index.js +1 -0
- package/dist/tools/cip/index.js +6 -3
- package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
- package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
- package/dist/tools/diagnostics/debug-start-session.js +1 -1
- package/dist/tools/docs/docs-read.js +4 -2
- package/dist/tools/docs/docs-search.js +10 -8
- package/dist/tools/docs/topics.d.ts +5 -0
- package/dist/tools/docs/topics.js +5 -0
- package/dist/tools/scapi/index.d.ts +4 -1
- package/dist/tools/scapi/index.js +4 -2
- package/dist/tools/scapi/scapi-code.d.ts +2 -2
- package/dist/tools/scapi/scapi-code.js +106 -81
- package/dist/tools/scapi/scapi-schemas-list.js +93 -56
- package/dist/utils/types.d.ts +6 -0
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +32 -0
- package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +54 -25
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/SKILL.md +2 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/SKILL.md +9 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/RUN-AND-MONITOR.md +35 -6
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +6 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +4 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/README.md +1 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +4 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-edge-traffic-triage/SKILL.md +69 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +13 -8
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +5 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
- package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
- package/oclif.manifest.json +21 -4
- package/package.json +4 -4
- package/content/guidance/mcp/scapi/SKILL.md +0 -203
- package/content/guidance/mcp/scapi/references/jobs.md +0 -30
- package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
- package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
- package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
- package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
- package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
- /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: server
|
|
3
|
-
description: B2C MCP
|
|
2
|
+
name: b2c-mcp-server
|
|
3
|
+
description: Index and setup for the B2C Commerce MCP server, covering toolset selection, tool choice by task, and the skill catalog. Use to enable tools, pick the right tool, or find the skill that covers a B2C task.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# B2C MCP Server
|
|
7
7
|
|
|
8
|
+
## Skill index
|
|
9
|
+
|
|
10
|
+
Read only the skill that matches the task; each links its own references.
|
|
11
|
+
|
|
12
|
+
| Task | Skill |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Commerce API reads/writes (required before `scapi_search` / `scapi_execute`) | `skill://mcp/b2c-mcp-scapi/SKILL.md` |
|
|
15
|
+
| Warehouse reports and SQL (required before `cip_query`) | `skill://mcp/b2c-mcp-cip/SKILL.md` |
|
|
16
|
+
| Configuration, credentials, access grants, wrong target | `skill://mcp/b2c-mcp-config/SKILL.md` |
|
|
17
|
+
| Server-side script debugging | `skill://mcp/b2c-mcp-debugger/SKILL.md` |
|
|
18
|
+
| Instance files and selected cartridge uploads | [files](references/files.md) |
|
|
19
|
+
| Production incident or unknown operational signal | `skill://b2c-ops/b2c-production-triage/SKILL.md` |
|
|
20
|
+
| Failed or late jobs | `skill://b2c-ops/b2c-job-health/SKILL.md` |
|
|
21
|
+
| Checkout or order failures | `skill://b2c-ops/b2c-checkout-triage/SKILL.md`, `skill://b2c-ops/b2c-order-failure-triage/SKILL.md` |
|
|
22
|
+
| Bots, scrapers or abusive traffic at the eCDN (WAF, firewall, rate limits) | `skill://b2c-ops/b2c-edge-traffic-triage/SKILL.md` |
|
|
23
|
+
| Anything else | `skill://index` |
|
|
24
|
+
|
|
25
|
+
Every skill and reference file is readable as an MCP resource
|
|
26
|
+
(`skill://<collection>/<skill>/<file>`) or with `skills_read({uri})`.
|
|
27
|
+
Collections: `b2c` (platform/cartridges), `b2c-cli` (CLI), `b2c-ops`
|
|
28
|
+
(operator/admin runbooks), `storefront-next` (storefronts), `mcp` (server/tool
|
|
29
|
+
workflows). Search with `skills_read({query, collection})` or browse `skill://index`.
|
|
30
|
+
|
|
8
31
|
## Server configuration and tool availability
|
|
9
32
|
|
|
10
33
|
Use the client's tool discovery before concluding a tool is unavailable.
|
|
@@ -40,7 +63,7 @@ Use launch arguments/environment for server settings, not project `.env` or `dw.
|
|
|
40
63
|
## Tool choice and project configuration
|
|
41
64
|
|
|
42
65
|
- Call `config_inspect` directly with the task's `projectDirectory`; secrets are
|
|
43
|
-
masked. For resolution issues: [B2C config](skill://mcp/b2c-config/SKILL.md).
|
|
66
|
+
masked. For resolution issues: [B2C config](skill://mcp/b2c-mcp-config/SKILL.md).
|
|
44
67
|
CLI equivalent, when requested: `b2c setup inspect`.
|
|
45
68
|
- Deploy cartridges: `cartridge_deploy`; CLI scripts/extra flags: `b2c code deploy`.
|
|
46
69
|
Confirm instance/version and preserve returned `resolution`. Use `files` for
|
|
@@ -50,37 +73,39 @@ Use launch arguments/environment for server settings, not project `.env` or `dw.
|
|
|
50
73
|
exact text by HTTP byte range or downloads to `outputPath`; `webdav_put` uploads
|
|
51
74
|
`content` or `sourcePath`. Prefer these over a terminal for supported transfers.
|
|
52
75
|
[File choices and limits](references/files.md).
|
|
53
|
-
- Debug: [MCP debugger](skill://mcp/debugger/SKILL.md). CLI/IDE only when requested.
|
|
76
|
+
- Debug: [MCP debugger](skill://mcp/b2c-mcp-debugger/SKILL.md). CLI/IDE only when requested.
|
|
54
77
|
- Prefer dedicated tools for their workflows. For other Commerce API tasks,
|
|
55
78
|
use `scapi_search` / `scapi_execute`: products, campaigns, promotions, jobs,
|
|
56
|
-
code versions, site cartridge paths, and more. Read [the SCAPI skill](skill://mcp/scapi/SKILL.md)
|
|
79
|
+
code versions, site cartridge paths, and more. Read [the SCAPI skill](skill://mcp/b2c-mcp-scapi/SKILL.md)
|
|
57
80
|
first; its task map and built-in snippets cover recurring operations.
|
|
58
81
|
- Custom API scaffold: `b2c scaffold generate custom-api`; no MCP equivalent.
|
|
59
82
|
- API/product documentation: `docs_search` / `docs_read`.
|
|
60
83
|
- Warehouse analytics: `cip_discover` for reports/metadata, `cip_query` for report
|
|
61
|
-
or SQL execution. Read [CIP analytics](skill://mcp/cip/SKILL.md) before execution.
|
|
84
|
+
or SQL execution. Read [CIP analytics](skill://mcp/b2c-mcp-cip/SKILL.md) before execution.
|
|
62
85
|
Prefer CIP for sales/merchandising/technical trends; SCAPI for current records.
|
|
63
|
-
- Operations or incidents:
|
|
64
|
-
`skills_read` with `collection: "b2c-ops"` and
|
|
65
|
-
|
|
66
|
-
relevant references. Runbooks guide evidence and handoff, not authorization
|
|
86
|
+
- Operations or incidents: start with the matching `b2c-ops` runbook from the
|
|
87
|
+
[skill index](#skill-index), or `skills_read` with `collection: "b2c-ops"` and
|
|
88
|
+
the task query. Read only relevant references. Runbooks guide evidence and handoff, not authorization
|
|
67
89
|
to rerun jobs or change data. CLI fallback is appropriate for an uncovered
|
|
68
90
|
signal when terminal access is available; a skill does not supply that access.
|
|
69
91
|
|
|
70
92
|
Do not infer tool names from CLI commands. Check a mutation's outcome before
|
|
71
93
|
retrying after missing output.
|
|
72
94
|
|
|
73
|
-
##
|
|
95
|
+
## Loading skills
|
|
74
96
|
|
|
75
|
-
|
|
76
|
-
`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
If the client lists this server's skills, load them through it. Otherwise read
|
|
98
|
+
`skill://` URIs as MCP resources, or with `skills_read({uri})`.
|
|
99
|
+
Use a skill's listed name or URI; do not derive names from the server name.
|
|
100
|
+
Relative links resolve against the linking skill's directory.
|
|
101
|
+
Skills cite documentation IDs as `b2c docs read <id>` or `docs_read({query: "<id>"})`;
|
|
102
|
+
read them with `docs_read({query: "<id>"})` (no terminal needed). Online links
|
|
103
|
+
point to the same pages as Markdown. Doc IDs are lookup keys: when citing
|
|
104
|
+
sources to the user, link the doc's `url` from `docs_read`, unless they ask for
|
|
105
|
+
IDs or Markdown links (`sourceUrl`).
|
|
106
|
+
Result `skillReferences` point to optional detail for observed conditions:
|
|
107
|
+
read the URI, or pass its URI and `section` to `skills_read`. Skills are
|
|
108
|
+
directory-agnostic.
|
|
84
109
|
|
|
85
110
|
Tools needing a skill name it in their description; no universal read is
|
|
86
111
|
required. Resource and tool reads are equivalent; do not read both.
|
|
@@ -91,9 +116,11 @@ When scripting tool calls, emit `structuredContent` when present, otherwise
|
|
|
91
116
|
|
|
92
117
|
## Setup references
|
|
93
118
|
|
|
94
|
-
|
|
95
|
-
|
|
119
|
+
Documentation IDs below are read with `docs_read({query: ID})`.
|
|
120
|
+
|
|
121
|
+
- Credentials, external grants, or access failures: [MCP configuration](skill://mcp/b2c-mcp-config/SKILL.md),
|
|
122
|
+
`skills_read({id: "mcp/b2c-mcp-config", section: "setup-and-access"})`.
|
|
96
123
|
It maps setup issues to exact documentation IDs; no universal setup read is needed.
|
|
97
|
-
- [Client installation](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/installation)
|
|
98
|
-
-
|
|
99
|
-
-
|
|
124
|
+
- [Client installation](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/installation.md)
|
|
125
|
+
- Launch configuration: `mcp-configuration` ([online](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/configuration.md))
|
|
126
|
+
- Capabilities and toolsets: `mcp-toolsets` ([online](https://salesforcecommercecloud.github.io/b2c-developer-tooling/mcp/toolsets.md))
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfnext-accessibility
|
|
3
|
+
description: >-
|
|
4
|
+
Build and fix accessible UI in a Storefront Next storefront (WCAG 2.1 AA): jsx-a11y lint findings, missing accessible names and labels, form error association, dialog focus management, aria-live status messages, keyboard behavior, color contrast, and verifying fixes with Storybook a11y/play() tests and the e2e axe scan with its baseline. Use for "accessibility", "a11y", "WCAG", "screen reader", "aria-label", "focus trap", "axe violation", pnpm lint:a11y, pnpm a11y, a11y-baseline.json, skip-a11y, STORYBOOK_A11Y_TEST_MODE, or an accessibility audit finding to fix. Do not use for general lint/typecheck gates (use `storefront-next:sfnext-quality-gates`), writing non-accessibility tests (use `storefront-next:sfnext-testing`), or color/token design (use `storefront-next:sfnext-theming`).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Storefront Next Accessibility
|
|
8
|
+
|
|
9
|
+
Target: WCAG 2.1 AA. Accessibility is checked at three levels, cheapest first:
|
|
10
|
+
|
|
11
|
+
| Level | Tool | Catches |
|
|
12
|
+
|-------|------|---------|
|
|
13
|
+
| Lint | OxLint `jsx-a11y` (`pnpm lint`, `pnpm lint:a11y`) | Missing alt/labels, invalid ARIA, non-interactive handlers, ambiguous link text |
|
|
14
|
+
| Component | Storybook a11y addon (axe) and `play()` assertions | Contrast and name/role issues in a rendered state; focus, live regions, dialog behavior |
|
|
15
|
+
| Page | e2e axe scan (`pnpm a11y`) against `e2e/a11y-baseline.json` | Page composition, layout, mobile vs desktop |
|
|
16
|
+
|
|
17
|
+
Some things no scanner finds: focus order, meaning carried by color alone, 200%/400% zoom reflow, and what a screen reader actually announces. Those need keyboard testing, a story `play()` assertion of the DOM facts behind them, or a human with assistive technology.
|
|
18
|
+
|
|
19
|
+
## Author accessibly by default
|
|
20
|
+
|
|
21
|
+
1. Use the project's building blocks; they are already accessible in the general case:
|
|
22
|
+
- Radix-based primitives in `src/components/ui/` (dialog, dropdown-menu, sheet, tooltip, ...).
|
|
23
|
+
- `FormLabel`/`FormControl`/`FormMessage` from `@/components/ui/form` and the wrappers in `src/components/form-fields/` (they wire `aria-describedby` and invalid state from form context).
|
|
24
|
+
- `src/components/product-image` and `src/components/dynamic-image` (alt text), `src/components/radio-card` (grouped options), `src/components/skip-link.tsx` (first focusable element, targets `#main-content`), `src/components/announcement-banner`.
|
|
25
|
+
2. Icon-only controls need a translated accessible name: `<Button aria-label={t('close')}>`. Decorative icons get `aria-hidden="true"` and must not be focusable.
|
|
26
|
+
3. Every input needs a real label; errors must be programmatically associated and announced (form-field wrappers do this).
|
|
27
|
+
4. Use semantic elements first (`button`, `a`, `ul`, `h1..h6`); add ARIA only to fill gaps. Keep one `h1` per page and do not skip levels.
|
|
28
|
+
5. Status changes that happen without navigation (cart updates, promo applied, errors) need an `aria-live` region (`role="status"` or `role="alert"`); the message must be rendered into an existing live region or the region must exist before content changes.
|
|
29
|
+
6. Dialogs and drawers: focus moves in on open, is trapped, returns to the trigger on close, `Escape` closes. Use the Radix dialog primitives rather than hand-rolling.
|
|
30
|
+
7. Respect `prefers-reduced-motion` (see `src/components/fade-through-image` and `product-zoom-modal` for the pattern).
|
|
31
|
+
8. Keep visible focus styles; do not remove outlines without a replacement from the theme tokens.
|
|
32
|
+
9. Do not "fix" `role="list"` on a `ul`: it is deliberate (Tailwind's `list-style: none` removes list semantics in Safari + VoiceOver), and the lint config allows it.
|
|
33
|
+
|
|
34
|
+
## Fix the right layer
|
|
35
|
+
|
|
36
|
+
Before editing a shared primitive, check the call site.
|
|
37
|
+
|
|
38
|
+
- Call-site fix (most common): the primitive is correct but the caller passed no `aria-label`, a meaningless `alt`, or bypassed `FormLabel`. Fix the caller.
|
|
39
|
+
- Primitive fix: the shared component itself emits inaccessible markup. One change cascades to every usage, so keep it small and re-run the component's stories and snapshots.
|
|
40
|
+
- Many findings citing one primitive usually means one call-site pattern to correct, not a broken primitive.
|
|
41
|
+
|
|
42
|
+
## Reproduce, fix, confirm
|
|
43
|
+
|
|
44
|
+
Do not call something fixed from reading code. Capture a failing signal first, then the same check passing afterwards.
|
|
45
|
+
|
|
46
|
+
1. Name the state: default, form-error, modal-open, out-of-stock, focus-after-action, zoomed. Many violations only exist after interaction, which is why default-page scans come back clean.
|
|
47
|
+
2. Reproduce:
|
|
48
|
+
- Lint rule: `pnpm lint:a11y`.
|
|
49
|
+
- Rendered axe rule: run the story with `STORYBOOK_A11Y_TEST_MODE=error` via `pnpm storybook:test --type=a11y`, or add the scenario to the e2e a11y specs.
|
|
50
|
+
- Focus/label/live-region issues: write a `play()` assertion (next section) and watch it fail.
|
|
51
|
+
3. Fix at the right layer.
|
|
52
|
+
4. Re-run the same check; also run the component's snapshot (`pnpm storybook:test --type=snapshot`, `--update` only after reviewing the diff) and `pnpm lint`.
|
|
53
|
+
5. Never add a suppression (disabled axe rule, `oxlint-disable`, `aria-hidden`) just to turn a check green. A suppression is acceptable only when it targets a node you do not control and the reason is written next to it.
|
|
54
|
+
|
|
55
|
+
## Storybook: a11y addon and play() assertions
|
|
56
|
+
|
|
57
|
+
- Default addon mode is `todo` (violations are shown, not failing). `pnpm storybook:test --type=a11y` runs in error mode, so violations fail. `STORYBOOK_DISABLE_A11Y=true` turns it off.
|
|
58
|
+
- Opt one story file into strict mode: spread `{ a11y: { test: 'error' } }` into `parameters` (see `src/components/checkout/storybook/checkout-strict-a11y-parameters.ts`).
|
|
59
|
+
- Tag `skip-a11y` excludes a story from a11y runs. Use it rarely and comment why.
|
|
60
|
+
- Assert accessible outcomes, not CSS classes:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
play: async ({ canvasElement }) => {
|
|
64
|
+
await waitForStorybookReady(canvasElement);
|
|
65
|
+
const body = within(canvasElement.ownerDocument.body); // Radix portals render into <body>
|
|
66
|
+
const dialog = body.getByRole('dialog');
|
|
67
|
+
await expect(dialog).toBeInTheDocument();
|
|
68
|
+
await expect(body.getAllByRole('textbox')[0]).toHaveFocus();
|
|
69
|
+
await expect(body.getByRole('textbox', { name: /email/i })).toBeInTheDocument(); // label association
|
|
70
|
+
await expect(body.getByRole('status')).toHaveTextContent(/saved/i); // live region populated
|
|
71
|
+
},
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A working reference is `src/components/login/stories/otp-modal.stories.tsx`. Imports: `expect, within, userEvent` from `storybook/test`; `waitForStorybookReady` from `@storybook/test-utils`. Tag the story `interaction` so it runs under `--type=interaction`.
|
|
75
|
+
|
|
76
|
+
## e2e axe scan and baseline
|
|
77
|
+
|
|
78
|
+
`pnpm a11y` runs axe (WCAG 2.1 A/AA tags) over key pages at desktop and mobile viewports and compares with `e2e/a11y-baseline.json`. CI fails when critical or serious violations increase or a new critical/serious rule appears; moderate and minor regressions are logged but do not block.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm a11y # scan and compare with baseline
|
|
82
|
+
pnpm --dir e2e a11y:report # or from e2e/: markdown + HTML report of violations
|
|
83
|
+
pnpm --dir e2e a11y:update-baseline # after fixing: ratchet the baseline down, review the diff, commit
|
|
84
|
+
pnpm a11y:scan-coverage # checks that every page route is scanned or explicitly allowlisted
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- Never hand-edit the baseline; regenerate it.
|
|
88
|
+
- New pages: add a `Scenario` in `e2e/src/specs/core/a11y/` (public, account or orders spec), then run `a11y:update-baseline`. Details: `e2e/docs/a11y.md`.
|
|
89
|
+
- The dev server must be running (`pnpm dev`) or use `--mode=local` as described in `storefront-next:sfnext-testing`.
|
|
90
|
+
|
|
91
|
+
## Translated text
|
|
92
|
+
|
|
93
|
+
`jsx-a11y/anchor-ambiguous-text` only sees literal JSX text. A link whose text comes from `t('...')` is never checked, so review link and label copy in `src/locales/*/translations.json` for "click here"/"read more" style text, in every locale you ship. See `storefront-next:sfnext-i18n`.
|
|
94
|
+
|
|
95
|
+
More checklists (states, keyboard, pages to spot check): [references/checklist.md](references/checklist.md).
|
|
96
|
+
|
|
97
|
+
## Related Skills
|
|
98
|
+
|
|
99
|
+
- `storefront-next:sfnext-quality-gates` - lint config and pre-PR checklist
|
|
100
|
+
- `storefront-next:sfnext-testing` - story, unit and e2e test mechanics
|
|
101
|
+
- `storefront-next:sfnext-components` - component and form-field conventions
|
|
102
|
+
- `storefront-next:sfnext-theming` - color tokens and contrast
|
|
103
|
+
- `storefront-next:sfnext-i18n` - translated labels and link text
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Accessibility checklists
|
|
2
|
+
|
|
3
|
+
## Classify a finding
|
|
4
|
+
|
|
5
|
+
| Question | If yes |
|
|
6
|
+
|----------|--------|
|
|
7
|
+
| Is there a DOM fact a scanner or assertion can check (missing name, unlabeled input, empty live region, `aria-hidden` on focusable, duplicate id, empty heading, contrast)? | Automatable. Reproduce with axe (story a11y run or e2e scan) and fix. |
|
|
8
|
+
| Is it about focus landing in the right place, roving arrow keys, trap/return, live region populated? | Has a DOM correlate. Assert it in a story `play()`. |
|
|
9
|
+
| Is it reading order, meaning conveyed by color alone, zoom/reflow at 200% to 400%, or exactly what VoiceOver/NVDA speaks? | Manual. Test with the keyboard, browser zoom and a screen reader; record the result. Do not close it as "cannot reproduce" because a scanner is clean. |
|
|
10
|
+
|
|
11
|
+
For "status message is not announced": if a live region should exist in the DOM, it is assertable; if the claim is purely about speech output, test with assistive technology.
|
|
12
|
+
|
|
13
|
+
## States to exercise
|
|
14
|
+
|
|
15
|
+
Scan or assert in each relevant state, not only the settled default:
|
|
16
|
+
|
|
17
|
+
- default
|
|
18
|
+
- form-error (submit empty or invalid)
|
|
19
|
+
- modal, drawer or menu open
|
|
20
|
+
- out-of-stock / unavailable variant
|
|
21
|
+
- after an action (focus after add-to-cart, after closing a dialog)
|
|
22
|
+
- zoomed to 400% / narrow viewport
|
|
23
|
+
- mobile and desktop viewports
|
|
24
|
+
- reduced motion enabled
|
|
25
|
+
|
|
26
|
+
Prefer states that do not depend on live catalog data for repeatable checks; data-dependent states (out-of-stock, specific content) can differ between local and CI backends.
|
|
27
|
+
|
|
28
|
+
## Keyboard pass (per page or component)
|
|
29
|
+
|
|
30
|
+
- Tab order follows the visual order; nothing focusable is hidden; a visible focus indicator is always present.
|
|
31
|
+
- All controls operable with Enter/Space; menus, tabs, carousels and swatch groups support arrow keys as expected.
|
|
32
|
+
- `Escape` closes dialogs and popovers; focus returns to the trigger.
|
|
33
|
+
- No keyboard trap outside intentional modal containment.
|
|
34
|
+
- The skip link is the first Tab stop and moves focus to `#main-content`.
|
|
35
|
+
|
|
36
|
+
## Forms
|
|
37
|
+
|
|
38
|
+
- Each field has a visible label associated through `FormLabel` or `htmlFor`.
|
|
39
|
+
- Error text is associated (`aria-describedby`) and the field is `aria-invalid`; on a failed submit, move focus to the first invalid field or an error summary (verify the behavior of the form you are editing).
|
|
40
|
+
- Required state is conveyed in text, not color alone.
|
|
41
|
+
- Autocomplete attributes are set for address, email and payment fields.
|
|
42
|
+
|
|
43
|
+
## Images and media
|
|
44
|
+
|
|
45
|
+
- Product and content images use `ProductImage`/`DynamicImage` with meaningful alt text; decorative images use empty alt.
|
|
46
|
+
- Icon-only buttons have translated accessible names.
|
|
47
|
+
- Carousels: labelled region, pause/controls reachable by keyboard, reduced motion respected.
|
|
48
|
+
|
|
49
|
+
## Content and structure
|
|
50
|
+
|
|
51
|
+
- One `h1` per page; headings in order.
|
|
52
|
+
- Landmarks (`header`, `nav`, `main`, `footer`) present once each with labels where repeated.
|
|
53
|
+
- Link text makes sense out of context, in every locale.
|
|
54
|
+
- Lists use list markup; keep `role="list"` on styled `ul` (Safari + VoiceOver).
|
|
55
|
+
|
|
56
|
+
## Where to run what
|
|
57
|
+
|
|
58
|
+
| Goal | Command |
|
|
59
|
+
|------|---------|
|
|
60
|
+
| Lint-level a11y only | `pnpm lint:a11y` |
|
|
61
|
+
| Rendered component violations | `pnpm storybook:test --type=a11y` |
|
|
62
|
+
| Focus/aria behavior | `pnpm storybook:test --type=interaction` |
|
|
63
|
+
| Full-page scan vs baseline | `pnpm a11y` |
|
|
64
|
+
| Report with HTML snippets for tickets | `pnpm --dir e2e a11y:report` |
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfnext-analytics-consent
|
|
3
|
+
description: >-
|
|
4
|
+
Storefront Next analytics: engagement adapters (Einstein, Active Data, Data 360), adding a custom adapter, tracking consent gating, PageViewTracker, useAnalytics events, and first-touch attribution (dw_attribution). Use when configuring engagement.adapters in config.server.ts, writing an adapter with hasConsent, registering it in initializeEngagementAdapters, wiring the consent banner (trackingConsent, consentCategories, dw_dnt), firing trackViewProduct/trackCartItemAdd events, debugging why no analytics events are sent, or passing campaign attribution to orders. Do not use for general config loading or env vars (use `storefront-next:sfnext-configuration`), CSP/script allowlisting of third-party tags (use `storefront-next:sfnext-security`), or SEO meta/JSON-LD (use `storefront-next:sfnext-seo`).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Storefront Next Analytics and Consent
|
|
8
|
+
|
|
9
|
+
Events flow: component -> `useAnalytics()` -> event mediator (`@salesforce/storefront-next-runtime/events`) -> each registered engagement adapter. Every adapter checks shopper consent before sending. Read `docs/README-ADAPTER-PATTERN-GUIDE.md` and `docs/README-CONSENT-TRACKING.md` in your project for the full guides; where they disagree with the code, trust the code (paths below were verified).
|
|
10
|
+
|
|
11
|
+
## Where things live
|
|
12
|
+
|
|
13
|
+
| Concern | Location |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Adapter config | `engagement.adapters.*` in `config.server.ts` |
|
|
16
|
+
| Adapter types, store, `hasConsent`, `buildConsentPreferences` | `@/lib/adapters` (`src/lib/adapters/engagement/`) |
|
|
17
|
+
| Registration of built-in adapters | `src/lib/adapters/engagement/register.ts` (`initializeEngagementAdapters`) |
|
|
18
|
+
| Built-in adapters | `einstein.ts`, `active-data.ts`, `data360.ts` in the same folder |
|
|
19
|
+
| Page view tracking | `src/analytics/page-view-tracker.tsx` (`PageViewTracker`, mounted in `src/root.tsx`) |
|
|
20
|
+
| Event hooks | `@/hooks/use-analytics`, `@/hooks/use-tracking-consent` |
|
|
21
|
+
| Attribution | `src/lib/attribution.ts`, `@/hooks/use-attribution`, `src/middlewares/attribution-forwarding.server.ts` |
|
|
22
|
+
|
|
23
|
+
## Configure built-in adapters
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
// config.server.ts
|
|
27
|
+
engagement: {
|
|
28
|
+
adapters: {
|
|
29
|
+
einstein: { enabled: true, consentCategory: 'analytics', host, einsteinId, realm, siteId, isProduction: false,
|
|
30
|
+
eventToggles: { view_page: true, view_product: true /* ... */ } },
|
|
31
|
+
data360: { enabled: true, consentCategory: 'analytics', appSourceId, tenantId, siteId, webStoreId: 'sfnext', eventToggles: { /* ... */ } },
|
|
32
|
+
activeData: { enabled: true, /* see config.server.ts */ },
|
|
33
|
+
},
|
|
34
|
+
analytics: {
|
|
35
|
+
trackingConsent: { enabled: true, defaultTrackingConsent: TrackingConsent.Declined,
|
|
36
|
+
consentCategories: ['necessary', 'analytics', 'marketing', 'personalization'] },
|
|
37
|
+
pageViewsBlocklist: [/* paths that must not emit view_page */],
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- The shipped IDs (einsteinId, realm, tenantId, ...) are sample values. Replace them with your own before go-live, or set `enabled: false`.
|
|
43
|
+
- An adapter with `consentCategory: 'analytics'` sends nothing unless `'analytics'` is in `trackingConsent.consentCategories`.
|
|
44
|
+
- `eventToggles` turns individual event types on or off per adapter. Data 360 ships only view/impression events enabled.
|
|
45
|
+
- The `einstein` and `data360` adapter blocks, and `activeData.enabled` / `activeData.eventToggles`, are protected config paths and cannot be overridden with `PUBLIC__` env vars; edit `config.server.ts` and rebuild. Other keys follow the `PUBLIC__app__engagement__...` pattern (see `storefront-next:sfnext-configuration`).
|
|
46
|
+
|
|
47
|
+
## Fire events
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { useAnalytics } from '@/hooks/use-analytics';
|
|
51
|
+
|
|
52
|
+
const { trackViewProduct, trackCartItemAdd } = useAnalytics();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`useAnalytics` returns `trackViewPage`, `trackViewProduct`, `trackCartItemAdd`, `trackCheckoutStart`, `trackCheckoutStep`, `trackViewSearch`, `trackViewCategory`, `trackClickProductIn{Category,Search,Recommender}`, `trackViewRecommender`, search-suggestion and wishlist trackers. On the server these are no-ops, so call them from effects or event handlers. Check the hook source for exact argument shapes before calling.
|
|
56
|
+
|
|
57
|
+
## Consent
|
|
58
|
+
|
|
59
|
+
Consent is read from the auth session (`dw_dnt` cookie) by `useTrackingConsent()`, converted to a `ConsentPreferences` array by `buildConsentPreferences(trackingConsent, consentCategories, isTrackingConsentEnabled)`, and passed to every adapter. While consent is undetermined or declined, no events are sent.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { useTrackingConsent } from '@/hooks/use-tracking-consent';
|
|
63
|
+
import { TrackingConsent } from '@/types/tracking-consent';
|
|
64
|
+
|
|
65
|
+
const { shouldShowBanner, setTrackingConsent } = useTrackingConsent();
|
|
66
|
+
setTrackingConsent(TrackingConsent.Accepted);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Granular per-category consent (for example from a CMP) means replacing the binary banner logic that feeds `buildConsentPreferences`; adapters already gate per `consentCategory`.
|
|
70
|
+
|
|
71
|
+
## Add a custom adapter
|
|
72
|
+
|
|
73
|
+
See [references/CUSTOM-ADAPTER.md](references/CUSTOM-ADAPTER.md). In short: implement `createMyAdapter(config): EngagementAdapter` using `hasConsent`, register it with `addAdapter('my-adapter', ...)` inside `initializeEngagementAdapters`, and add `engagement.adapters.myAdapter` config (the config type allows extra keys).
|
|
74
|
+
|
|
75
|
+
## Attribution
|
|
76
|
+
|
|
77
|
+
A first-touch `dw_attribution` cookie captures allow-listed landing/referrer params (see `LANDING_PARAM_ALLOWLIST` in `src/lib/attribution.ts`). `attributionForwardingMiddleware` forwards it on order creation. Add a parameter by extending the allowlist; cookie size is capped (`MAX_ATTRIBUTION_COOKIE_VALUE_LENGTH`).
|
|
78
|
+
|
|
79
|
+
## Troubleshooting
|
|
80
|
+
|
|
81
|
+
- No events at all: consent not accepted, `'analytics'` missing from `consentCategories`, adapter `enabled: false`, or the path is in `pageViewsBlocklist`. Startup logs a warning when consent categories are empty.
|
|
82
|
+
- Custom adapter never fires: it was not registered in `initializeEngagementAdapters`, or `eventToggles[eventType]` is falsy.
|
|
83
|
+
- Third-party script or beacon blocked: CSP, see `storefront-next:sfnext-security`.
|
|
84
|
+
|
|
85
|
+
## Related Skills
|
|
86
|
+
|
|
87
|
+
- `storefront-next:sfnext-configuration` - config.server.ts, env overrides
|
|
88
|
+
- `storefront-next:sfnext-security` - CSP for analytics endpoints
|
|
89
|
+
- `storefront-next:sfnext-authentication` - session/cookies behind `dw_dnt`
|
|
90
|
+
- `storefront-next:sfnext-testing` - testing adapters and hooks
|
|
91
|
+
- `storefront-next:sfnext-seo` - page metadata and structured data
|
package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md
ADDED
|
@@ -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).
|