Install JavaScript using NPM Package

To install JavaScript code as an NPM package, follow the instructions below:

  1. Install the Package: Open your terminal or command prompt.

npm i reodotdev
# or
yarn add reodotdev
  1. Integrate the Package into Your Project: Within your project, identify the file or module where you want to incorporate the user activity tracking.

  2. Use with NPM: Import the required function from the installed package and set up the script to load the Reo tracking.

For Documentation

Copy the below JavaScript code snippet

// Use with NPM
import { loadReoScript } from 'reodotdev'

// Declare clientID from environment variable or directly as string
const clientID = process.env.CLIENT_ID || "XXXXXXXXXX";

// Resolve promise to get access to methods on Reo
const reoPromise = loadReoScript({ clientID });
reoPromise
  .then(Reo => {
     Reo.init({ clientID });
  })
  .catch(error => {
    console.error('Error loading Reo', error);
  })

Replace the Client ID XXXXXXXX in the above code with the client code in Integrations > Input Sources > Documentation

For Website

Copy the below JavaScript code snippet

Replace the Client ID XXXXXXXX in the above code with the client code in Integrations > Input Sources > Website

  1. Adjust Environment Variables (if needed)

    If using environment variables, make sure to set them up in your environment configuration or .env files.

  2. Save Changes:

    Save the file containing the updated code.

  3. Build and Deploy:

    Compile or bundle your project based on your build process, and deploy the changes to your server or hosting service.

  4. Verification:

  5. Go to any screen after login and right-click anywhere

  6. In the dropdown menu, select Inspect.

  1. In the elements tab, Use the Ctrl + F or Cmd + F and search for “reo”

  1. If the tracking code appears, verify that the code matches.

Last updated

Was this helpful?