Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Install third-party npm packages

Describes how to install third-party npm packages in Spire.

Configured Commerce lets partners and clients install third-party npm packages within Spire.

  1. Go to src/FrontEnd/modules/blueprints/{BlueprintThatNeedsCustomPackage}.
  2. Use npm install --save {PackageName} to install all the package(s) needed for development. This adds or updates a file at src/FrontEnd/modules/blueprints/{BlueprintThatNeedsCustomPackage}/package.json.

    🚧

    Important

    The installation of third-party npm packages only works under the blueprint folder. Installing the packages under src/FrontEnd (which is the root folder of Spire) may cause build failure.

  3. Push the changes to sandbox branch. 
    • Optimizely uses the Workspaces feature of npm to link the blueprint packages and the Spire package. More details can be found here: https://docs.npmjs.com/cli/v7/using-npm/workspaces.
    • Each Workspace is one blueprint folder under src/FrontEnd/modules/blueprints. A Powershell script runs during build time to generate workspaces in the package.json of the Spire root automatically.

📘

Note

As of June 27, 2024, Optimizely no longer checks the licenses for third-party packages included in partner or customer builds, leaving you responsible for any licensing. If you have questions about what license types you should use, check with your company's compliance or legal departments.