Skip to content

Installation

Install react-performance-tracking using your preferred package manager.

Install the Package

npm
npm install react-performance-tracking

Peer Dependencies

The package has optional peer dependencies. Install only what you need:

{
  "react": "^18.0.0 || ^19.0.0",
  "@playwright/test": "^1.40.0"
}
DependencyWhen to Install
reactUsing the React provider/hooks in your app
@playwright/testUsing the Playwright test integration

Package Exports

The library provides three import paths:

// Main entry - re-exports both layers
import { ... } from 'react-performance-tracking';
 
// React only - provider and hooks
import { ... } from 'react-performance-tracking/react';
 
// Playwright only - test utilities
import { ... } from 'react-performance-tracking/playwright';

Using specific subpaths helps with tree-shaking and keeps your bundles smaller.

TypeScript Support

The package is written in TypeScript and includes full type definitions. No additional @types/* packages needed.

import type {
  TestConfig,
  PerformanceInstance,
  PerformanceSample,
} from 'react-performance-tracking/playwright';

Next Steps

Now that you've installed the package:

  1. Quick Start – Write your first performance test
  2. React Setup – Configure the React provider
  3. Playwright Setup – Set up Playwright integration