The logrocket Developer Hub

Welcome to the logrocket developer hub. You'll find comprehensive guides and documentation to help you start working with logrocket as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting Started

Adding LogRocket to your JavaScript app.

Hi! Welcome to LogRocket :rocket+:

LogRocket helps you fix bugs and understand user behavior by capturing logs and session recordings from your app.

Getting started is easy:

  1. Visit https://app.logrocket.com to get an app ID.
  2. Install LogRocket via NPM or script tag:
$ npm i --save logrocket

// Code:

import LogRocket from 'logrocket';
LogRocket.init('app/id');
Add to your HTML:

<script src="https://cdn.logrocket.com/LogRocket.min.js"></script>
<script>window.LogRocket && window.LogRocket.init('apphub/logrocket');</script>
  1. If you're using Redux, install our Redux middleware:
import LogRocket from 'logrocket';
import { applyMiddleware, createStore } from 'redux';

const store = createStore(
  reducer, // your app reducer
  applyMiddleware(middlewares, LogRocket.reduxMiddleware()), // our middleware should go last
);
import { applyMiddleware, createStore } from 'redux';

const store = createStore(
  reducer, // your app reducer
  applyMiddleware(
    middlewares,
    window.LogRocket
      ? window.LogRocket.reduxMiddleware()
      : () => next => action => next(action)
  ) // our middleware should go last
);

What's Next

Learn more about the type of data the LogRocket collects to help fix bugs and understand user behavior.

Data Collection

Getting Started

Adding LogRocket to your JavaScript app.