Installation
Install react-performance-tracking using your preferred package manager.
Install the Package
npm
npm install react-performance-trackingPeer Dependencies
The package has optional peer dependencies. Install only what you need:
{
"react": "^18.0.0 || ^19.0.0",
"@playwright/test": "^1.40.0"
}| Dependency | When to Install |
|---|---|
react | Using the React provider/hooks in your app |
@playwright/test | Using 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:
- Quick Start – Write your first performance test
- React Setup – Configure the React provider
- Playwright Setup – Set up Playwright integration