Learn how to install ScandiPWA extensions both from remote registry and from local modules
Overview
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.
Install 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 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.
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
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:
Add the desired package to your project's dependencies (and fetch it)
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
# 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>