Installation
Learn how to install ScandiPWA extensions both from remote registry and from local modules
The
create-scandipwa-app
setup considers having BE and FE of your application completely separated.When you purchase an extension, you get access to all of its parts - both BE and FE. The BE part should be handled just as any other installable module for BE of your choice (e.g. Magento 2).
The frontend part of an extension is a regular node module with structure and contents dictated by the
create-scandipwa-app
plugin system.- 1.Download the archive containing the FE part of the extension from the marketplace.
- 2.Create a
packages/
directory inside of your theme's root. - 3.Put the archive's contents inside of the
packages/<package name>
directory. Make sure that you have apackages/<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.Add the following scripts to the
scripts
section of your theme'spackage.json
file. This is necessary for your package to be symlinked into thenode_modules
directory of your theme after manipulations with dependencies{"scripts": {"postinstall": "scandipwa-scripts link","postupdate": "scandipwa-scripts link"}} - 5.Add the extension to the dependencies of your theme, as follows:{"dependencies": {"<package name>": "file:packages/<package name>"}}
- 6.Update the symlinks by running the following command# For yarn usersyarn postinstall# For npm usersnpm run postinstall
Some of the FE ScandiPWA extensions are available for installation using
npm
and yarn
.The process is a 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.
- 2.Configure the token for your project2.1. Create an
.npmrc
file inside of your project's root directory, neighboring to thepackage.json
file. The.npmrc
file 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=$TOKEN - 3.Add the desired package to your project's dependencies (and fetch it)# Write a full commandyarn --registry https://r.scandipwa.com add <package>npm --registry https://r.scandipwa.com i <package># Or create an aliasalias yr='yarn --registry https://r.scandipwa.com'alias npr='npm --registry https://r.scandipwa.com'# and use ityr add <package>npr i <package>
- 4.When installing your project's dependencies, don't worry about any additional actions. The
yarn.lock
orpackage-lock.json
will contain all the necessary data# For yarn usersyarn# For npm usersnpm ci
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
}
}
}
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.
Last modified 2yr ago