novinzodevelopers
API referenceCore for pluginsStorefront injections

Set Injections

PUT/api/storefront/injection

Replaces the HTML the calling plugin adds to the store's storefront pages: head right before each page's , body right before its , each at most 16384 bytes, placed as given, unescaped. Every storefront page gets it except the checkout, order and subscription renewal pay pages and the pages plugins serve. Each origin list, at most 16 https origins, is added to one directive of those pages' Content Security Policy: scriptOrigins to script-src, connectOrigins (which also takes wss origins) to connect-src, and the optional styleOrigins, fontOrigins, imgOrigins and frameOrigins to style-src, font-src, img-src and frame-src. Pages show the change once core has announced it, which this call does. Idempotent. Uninstalling the plugin, or withdrawing storefront:inject, removes the injection from the pages. Requires the store to have granted the plugin storefront:inject.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

head*string
body*string
scriptOrigins*array<string>
Itemsitems <= 16
connectOrigins*array<string>
Itemsitems <= 16
styleOrigins?array<string>
Itemsitems <= 16
fontOrigins?array<string>
Itemsitems <= 16
imgOrigins?array<string>
Itemsitems <= 16
frameOrigins?array<string>
Itemsitems <= 16

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/storefront/injection" \  -H "Content-Type: application/json" \  -d '{    "head": "string",    "body": "string",    "scriptOrigins": [      "string"    ],    "connectOrigins": [      "string"    ]  }'
Empty