These docs are for v1.0. Click to read the latest docs for v3.0.

Disabling for certain users

How to prevent LogRocket from recording sessions for specific users

Many users choose to disable LogRocket for certain users (such as internal employees) to limit session usage. To do this, simply do not call init() during development:

import LogRocket from 'logrocket';

if (!userIsAdmin) {
  LogRocket.init('app/id');
}

That's it! LogRocket will only record sessions for which LogRocket.init() is called.