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.


How to install Chameleon with npm

Head over to your installation page and follow these steps.

  • Select “Install via NPM” as your installation method.

Install snippet

  • Run the script using a front-end bundler like Browserify or Webpack. You can then require the library like a standard Node.js module.

The token shown above is an example, you can get your unique token from your installation page.

Identify Users

  • Next, identify your users by sending a unique ID to Chameleon. This step is essential in displaying Experiences to your users. To get the most value out of Chameleon - creating target audiences, and segmenting users - you should send additional user or company data so you can target Experiences to the right users.

Note: Chameleon must be installed and be able to identify users on every page that you want Experiences to display (not just when users log in).

Enable Secure Identification

To improve security and prevent impersonation, we strongly recommend using secure identity verification. It works by adding an encrypted user_hash (HMAC) to your installation snippet. 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.

Keep in mind that your account will have secure identity verification enabled once your first verified request is received. Read more here.

⚠️ This key should not be shared with anyone, please add it as an environment variable on the backend responsible for generating this hash. If a third-party gains access to this key, this secure method would be compromised. If needed, Contact us to rotate your secret.

Verify a successful installation

Now that installation is done, it’s time to verify your installation and make sure that 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.


Learn more

Did this answer your question?