Migrate an Embedded Script Extension

Add an embedded script extension to your new Wix CLI project as part of migrating an app from the legacy Wix CLI.

Folder structure

Legacy pathNew path
src/site/embedded-scripts/<name>/embedded.jsonsrc/extensions/site/embedded-scripts/<name>/<name>.extension.ts
src/site/embedded-scripts/<name>/embedded.htmlsrc/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.

Step 1 | Copy and rename the files

In the new project:

  1. Create the folder src/extensions/site/embedded-scripts/<name>/.
  2. From the legacy project's src/site/embedded-scripts/<name>/ folder, copy embedded.html into the new folder, and rename it to <name>.html.
  3. Copy any other files the HTML references, such as a script file loaded with a relative 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.

Step 2 | Create the extension file

In the new project:

  1. In src/extensions/site/embedded-scripts/<name>/, create <name>.extension.ts.

  2. Add the following code, and set each field to the value the table below specifies:

    Copy
    FieldSource in legacy projectWhat to specify
    idid in embedded.jsonCopy source as is
    namename in embedded.jsonCopy source as is
    placementplacement in embedded.jsonCopy source as is
    scriptTypescriptType in embedded.jsonCopy source as is
    sourceNonePath 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.

Step 3 | Register the extension

In the new project, in src/extensions.ts:

  1. Import the extension:

    Copy
  2. Add a .use() call for it to the app() chain, on its own line:

    Copy

Step 4 | Return to the main migration guide

Return to Install the extension's dependencies in the main migration guide.

Last updated: 10 November 2026

Did this help?