custom_js_update
Replaces a Salla store's entire custom JavaScript after reading the current script, with a local backup and merchant approval before saving.
Instructions
Replace the store's entire custom JavaScript. Runs on every storefront page once saved (if custom JS is enabled). Always read the current JS first and pass the full new script. The previous JS is backed up locally before saving. Show the merchant the change and get their OK before calling.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"js": "<js>"
},
"name": "custom_js_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes | The complete new JavaScript. | |
| version_id | No | Theme version ID (from theme_versions_list). Defaults to 987654321. |