You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,6 +38,7 @@ Complete templates for the extension system. All files must use TypeScript (.ts/
31
38
-`path`: Relative path from `src/` to the component file
32
39
-`order`: Insertion order when multiple components target the same slot (lower = earlier)
33
40
-`contextProviders`: Application-root level providers (injected after ComposeProviders)
41
+
-`actionHooks`: Server-side handlers that run during storefront actions (see "Action Hook Handler" below)
34
42
-`devOnly`: (optional) Set to `true` to exclude extension from production builds
35
43
36
44
**⚠️ IMPORTANT:** Use `target-config.json` (not `plugin-config.json`) and `targetId` (not `pluginId`)
@@ -260,6 +268,115 @@ export function use{{AppName}}Context(): {{AppName}}ContextType {
260
268
- Use `useConfig<AppConfig>()` with TypeScript type for type-safe configuration access
261
269
- Access config with direct property access: `appConfig.extension?.{{appName}}?.key || defaultValue`
262
270
271
+
## Injecting External SDK Scripts
272
+
273
+
Context providers can render `<script src="...">` tags to load external vendor SDKs (fraud beacons, analytics, payment libraries). React 19 automatically hoists these to `<head>` and deduplicates by `src`.
Action hooks run server-side logic at specific points in the storefront flow. They are declared in `target-config.json` under `actionHooks` and execute in waterfall order with a 5-second timeout per handler.
328
+
329
+
**Available hook IDs:**
330
+
331
+
| Hook ID | Blocking | Purpose |
332
+
| :------ | :------- | :------ |
333
+
|`sfcc.checkout.fraud.afterSubmitContactInfo`| No | Fraud/identity checks after contact info submission |
334
+
|`sfcc.checkout.addressVerification.afterSubmitShippingAddress`| No | Address validation and standardization |
335
+
|`sfcc.checkout.shipping.afterMethodsFetch`| No | Enrich or filter shipping methods |
336
+
|`sfcc.checkout.shipping.afterMethodSelect`| No | Post-processing after shipping method selection |
337
+
|`sfcc.checkout.payments.afterSubmitPayment`| No | Post-payment processing (tokenization) |
338
+
|`sfcc.checkout.fraud.beforePlace`|**Yes**| Final fraud gate — can block order creation |
339
+
|`sfcc.checkout.payments.beforePlaceOrder`|**Yes**| Payment authorization gate — can block order creation |
340
+
|`sfcc.checkout.payments.afterPlaceOrder`| No | Post-order processing (payment capture) |
341
+
342
+
**Blocking** hooks abort the action on any failure. **Non-blocking** hooks log errors and continue. Throwing `ActionHookError` always aborts with a user-facing error.
0 commit comments