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.
Working with Magento modulesInstall from a local source
Download the archive containing the FE part of the extension from the marketplace.
Create a
packages/directory inside of your theme's root.Put the archive's contents inside of the
packages/<package name>directory. Make sure that you have apackages/<package name>/package.jsonfile 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/paypalis a valid package name.Add the following scripts to the
scriptssection of your theme'spackage.jsonfile. This is necessary for your package to be symlinked into thenode_modulesdirectory of your theme after manipulations with dependencies{ "scripts": { "postinstall": "scandipwa-scripts link", "postupdate": "scandipwa-scripts link" } }Add the extension to the dependencies of your theme, as follows:
{ "dependencies": { "<package name>": "file:packages/<package name>" } }Update the symlinks by running the following command
# For yarn users yarn postinstall # For npm users npm run postinstall
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:
Get the credentials (token) from the marketplace
Configure the token for your project
2.1. Create an
.npmrcfile inside of your project's root directory, neighboring to thepackage.jsonfile. The.npmrcfile should be created even if you are usingyarn.2.2. Put your token in there in the following format:
TOKEN=put.token.here //r.scandipwa.com/:_authToken=$TOKENAdd the desired package to your project's dependencies (and fetch it)
# Write a full command yarn --registry https://r.scandipwa.com add <package> npm --registry https://r.scandipwa.com i <package> # Or create an alias alias yr='yarn --registry https://r.scandipwa.com' alias npr='npm --registry https://r.scandipwa.com' # and use it yr add <package> npr i <package>When installing your project's dependencies, don't worry about any additional actions. The
yarn.lockorpackage-lock.jsonwill contain all the necessary data# For yarn users yarn # For npm users npm ci
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.
{
"scandipwa": {
"extensions": {
"<package name>": true
}
}
}Install by using scandipwa-cli
scandipwa-cliCurrently, 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 updated
Was this helpful?