Add an embedded script extension to your new Wix CLI project as part of migrating an app from the legacy Wix CLI.
| Legacy path | New path |
|---|---|
src/site/embedded-scripts/<name>/embedded.json | src/extensions/site/embedded-scripts/<name>/<name>.extension.ts |
src/site/embedded-scripts/<name>/embedded.html | src/extensions/site/embedded-scripts/<name>/<name>.html |
Note: <name> is your extension's folder name in the legacy project. The new folder and files use the same name.
In the new project:
src/extensions/site/embedded-scripts/<name>/.src/site/embedded-scripts/<name>/ folder, copy embedded.html into the new folder, and rename it to <name>.html.src, into the new folder.Don't copy the following legacy files:
embedded.json. You recreate its values in <name>.extension.ts.params.dev.json. Nothing in the new project reads it. If your HTML uses dynamic parameters, set their values by passing a parameters object to embedScript() when you embed the script in a site.Important:
A site, including your development site, runs the script only after embedScript() is called for it. In the legacy project, the development session loaded the script with the values from params.dev.json. In the new project, a migrated script shows nothing on a site until you or the site owner call the method. For how to make the call from your app, see Load the embedded script in your code.
In the new project:
In src/extensions/site/embedded-scripts/<name>/, create <name>.extension.ts.
Add the following code, and set each field to the value the table below specifies:
| Field | Source in legacy project | What to specify |
|---|---|---|
id | id in embedded.json | Copy source as is |
name | name in embedded.json | Copy source as is |
placement | placement in embedded.json | Copy source as is |
scriptType | scriptType in embedded.json | Copy source as is |
source | None | Path to <name>.html, relative to src/ |
Important:
The id must match the value from the legacy embedded.json. Otherwise, the new entry is treated as a separate extension instead of a continuation of the legacy one.
In the new project, in src/extensions.ts:
Import the extension:
Add a .use() call for it to the app() chain, on its own line:
Return to Install the extension's dependencies in the main migration guide.
Last updated: 10 November 2026