Installing an extension
ScandiPWA setup considers having the back-end (Magento 2 Module) and front-end (ScandiPWA Extensions) of your application completely separated. If you are looking for back-end part instructions, refer to the link below.

Install from a local source

  1. 1.
    Download the archive containing the FE part of the extension from the marketplace.
  2. 2.
    Create a packages/ directory inside of your theme's root.
  3. 3.
    Put the archive's contents inside of the packages/<package name> directory. Make sure that you have a packages/<package name>/package.json file present alongside all the other extension's contents, that means that you have unpacked the extension correctly. Note: <package name> can also include publisher, @scandipwa/paypal is a valid package name.
  4. 4.
    Add the following scripts to the scripts section of your theme's package.json file. This is necessary for your package to be symlinked into the node_modules directory of your theme after manipulations with dependencies
    1
    {
    2
    "scripts": {
    3
    "postinstall": "scandipwa-scripts link",
    4
    "postupdate": "scandipwa-scripts link"
    5
    }
    6
    }
    Copied!
  5. 5.
    Add the extension to the dependencies of your theme, as follows:
    1
    {
    2
    "dependencies": {
    3
    "<package name>": "file:packages/<package name>"
    4
    }
    5
    }
    Copied!
  6. 6.
    Update the symlinks by running the following command
    1
    # For yarn users
    2
    yarn postinstall
    3
    4
    # For npm users
    5
    npm run postinstall
    Copied!

Install with a package manager (beta)

Some of the FE ScandiPWA extensions are available for installation using npm and yarn.
The process is different from the regular module's installation, the ScandiPWA packages are stored in our own registry - r.scandipwa.com
The installation process is the following:
  1. 1.
    Get the credentials (token) from the marketplace
  2. 2.
    Configure the token for your project
    2.1. Create an .npmrc file inside of your project's root directory, neighboring to the package.json file. The .npmrc file should be created even if you are using yarn.
    2.2. Put your token in there in the following format:
    1
    TOKEN=put.token.here
    2
    //r.scandipwa.com/:_authToken=$TOKEN
    Copied!
  3. 3.
    Add the desired package to your project's dependencies (and fetch it)
    1
    # Write a full command
    2
    yarn --registry https://r.scandipwa.com add <package>
    3
    npm --registry https://r.scandipwa.com i <package>
    4
    5
    # Or create an alias
    6
    alias yr='yarn --registry https://r.scandipwa.com'
    7
    alias npr='npm --registry https://r.scandipwa.com'
    8
    9
    # and use it
    10
    yr add <package>
    11
    npr i <package>
    Copied!
  4. 4.
    When installing your project's dependencies, don't worry about any additional actions. The yarn.lock or package-lock.json will contain all the necessary data
    1
    # For yarn users
    2
    yarn
    3
    4
    # For npm users
    5
    npm ci
    Copied!

Enable the extension

Turn on the extension in your theme's package.json file. You may turn it off by changing true to false in the corresponding extensions block's entry.
1
{
2
"scandipwa": {
3
"extensions": {
4
"<package name>": true
5
}
6
}
7
}
Copied!

Install by using scandipwa-cli

Currently, it is possible to install the extensions published to npm with the scandipwa-cli package, by using scandipwa extension install command.
It is planned to provide support for installing local extensions in the future.
More information about installing via scandipwa-cli from npm registry see here.
Last modified 8mo ago