Installing the Personalization Library
The online engine of Acoustic Personalization evaluates rules and displays personalized content based on those rules for each registered zone.
Note:
- Personalization Library was formerly known as Online Engine.
- These steps provide information about configuring the Personalization Library (Online Engine) for an Angular Single-Page Application. In the case of a Multi-Page Application, the Personalization Library (Online Engine) is loaded into the browser by Acoustic Exchange Capture, so you can skip these steps.
Online Engine Library installation from Artifactory
To install packages from JFrog Artifactory, complete the following steps:
Prerequisite
- You must have the permissions to edit the channel (website).
- To execute the
npmcommands, you must install Node Package Manager. NPM is included with the recent versions of Node.js. - You must have access to the JFrog Artifactory to download the package.
Step 1: Update the .npmrc file for authorization
- Perform the following steps to get the API key:
- Log in to JFrog Artifactory. Click your user name to view your user profile.
- Generate the API key.
- Copy the API key displayed on the screen.
For more information, see the Npm Registry article on JFrog web site.
- Run the following command on the Git bash or on any terminal that allows curl commands, using
your IBMid credentials. This command changes the registry in the .npmrc file.
For Online Engine version <= 0.1.9, and For Personalization Library version = 1.0.0, 1.1.0, 1.1.1, or 1.1.2
curl -u <user-name@ibm.com>:<API-Key> https://na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/auth/wrtp >> ~/.npmrcFor Personalization Library version >= 1.2.0curl -u <user-name@ibm.com>:<API-Key> https://na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/auth/acoustic >> ~/.npmrc - Run the following command in the command prompt:
%USERPROFILE%/.npmrc - Open the .npmrc file. It now displays the registry changes. New value for
the registry is:
If you see an error similar to the following in the .npmrc file,@<SCOPE>:registry=https://na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/ //na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/:_password=<BASE64_PASSWORD> //na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/:username=<USERNAME> //na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/:email=youremail@email.com //na.artifactory.swg-devops.com/artifactory/api/npm/wce-wrtp-public-npm-local/:always-auth=true
Remove the output generated due to incorrect credentials, and rerun the curl command using correct credentials.{"errors" : [{"status": 401,"message":"Bad credentials"}]}
Step 2: Install the packages
Install the packages with either of the following methods. Ensure that you run the command from
the root directory of the application.
- For Online Engine version <= 0.1.9 and For Personalization Library version = 1.0.0, 1.1.0, 1.1.1, or 1.1.2
-
- Run the following command to install the latest version of the deployed packages.
npm install --save @wrtp/ole - Run the following command to install the deployed packages with specific version.
npm install --save @wrtp/ole@version
- Run the following command to install the latest version of the deployed packages.
- For Personalization Library version >= 1.2.0
-
- Run the following command to install the latest version of the deployed packages.
npm install --save @acoustic/personalization - Run the following command to install the deployed packages with specific version.
npm install --save @acoustic/personalization@version
- Run the following command to install the latest version of the deployed packages.
Tip: During the installation, you might see some warning messages in the console
window. You can safely ignore these warnings as they do not impact the package installation.