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

Use captureException to manually report an Error:

try {
  doSomethingBroken();
} catch (err) {
  LogRocket.captureException(err, {
    tags: {
      // additional data to be grouped as "tags"
      subscription: 'Pro',
    },
    extra: {
      // additional arbitrary data associated with the event
      pageName: 'ProfileView',
    },
  });
}

Use tags and extra to send additional metadata with the error. The values contained in the tags and extra objects must be scalar values (e.g., booleans, numbers, or strings).