Installation
For instructions on how to install the widget via CDN, contact us at hello@econans.com.
Quick start
To get up and running with the Green Housing widget, follow these steps:
- Log in to Econans Package Registry (EPR)
npm login --registry https://dist.econans.se/
- Link the
@econans
package scope to EPR
npm config set @econans:registry https://dist.econans.se/
- Install Green Housing widget
npm install @econans/green-housing
For detailed instructions, read more below.
Detailed instructions
The Green Housing widget can be installed with any common Javascript package manager like npm or yarn, via the Econans Package Registry (EPR). In the following examples we use npm. Please note that the commands might differ slightly depending on the package manager and the version of it that you are using. If you are behind a proxy, you might also need to configure this in your package manager. Please refer to the documentation of your package manager for more information if needed.
- Log in to EPR with your user credentials
- Link the package scope
@econans
to the correct registry URL - Installing Green Housing
After following these steps, your .npmrc
file should include these two lines:
# ~/.npmrc
@econans:registry=https://dist.econans.se/
//dist.econans.se/:_authToken=<SOME_GENERATED_TOKEN>
Example of .npmrc file after running the commands above
The token will look something like this:
1W18plkFqOJSdlMU+vVs/pcbZvJ0LQ8+wwMmlcLwY2x4kt+yPCRR1cAQngJq0eDp
Example of an authentication token
Log in
User credentials for EPR is provided by Econans.
Package managers typically use a configuration file to configure things like package scopes and authentication tokens, such as an .npmrc
file in the project root, or in the computer’s user account root. This is where the authentication token generated by logging in to EPR is saved.
npm login --registry https://dist.econans.se/
Command to login to EPR
Link scope
The scope @econans
needs to be linked to the correct URL. This is configured in .npmrc
and can be done manually or by running the following command:
npm config set @econans:registry https://dist.econans.se/
Command to link the
@econans
package scope to EPR
Installing Green Housing
After you have linked the scope and authenticated against EPR, you can install Green Housing:
npm install @econans/green-housing
Using npm to install Green Housing
CI environment
Authentication against EPR in a CI environment is usually done by creating a configuration file for the package manager (i.e. .npmrc
) in the project root. This must then point the @econans
package scope to the URL of EPR, as well as contain an authentication template string, that can then read an authentication token from the CI environment it’s being run in.
# <project root>/.npmrc
@econans:registry=https://dist.econans.se/
//dist.econans.se/:_authToken=${ env.EPR_AUTH_TOKEN }
Example of a
.npmrc
file in a CI environment