Npm is a node JS package manager that allows you to install all dependencies needed into your project. Chameleon is available as an npm package that you can easily install by first running the install script in a front-end packager like Browserify or Webpack.
We recommend using npm if you are working with Node.js and other front-end frameworks such as React JS, Vue.js, and AngularJS.
Installing Chameleon via npm has 2 essential components:
installing the code snippet -- the Chameleon functionalities that allow you to create and publish Experiences
identifying users correctly -- the identification method that Chameleon uses to keep track of what to show to your users
Head over to your installation page in your Dashboard, select “Install via NPM” as your installation method, and follow these steps.
First, run the script from your Dashboard using a front-end bundler like Browserify or Webpack. You can then require the library like a standard Node.js module.
Next, you'll identify your users by sending a unique
ID to Chameleon. This step is essential in displaying Experiences to your users.
Keep in mind that your account will have secure identity verification enabled once your first verified request is received. Read more here.
Chameleon won’t accept sign-in requests without a valid user_hash. This user_hash is calculated using a secret key, by which Chameleon verifies the authenticity of requests made to our API.
You can verify your installation to make sure Chameleon has been successfully added to your domain or subdomain. Domains will show up automatically if data is being received. You can do this from the installation section of your Dashboard.
This is to ensure better security and that no malicious domains get added to your account by default.