React
Installation
Learn how to install and set up the Traque React SDK in your application
Installation
You can install the Traque React SDK using your preferred package manager:
Requirements
- React 16.8+ (for Hooks support)
- @traque/core package (installed automatically as a dependency)
Initial Setup
After installing the package, you'll need to initialize the Traque client and wrap your application with the TraqueProvider
. Here's a basic setup:
Configuration Options
When initializing the Traque client, you can provide several configuration options:
Option | Type | Description | Required |
---|---|---|---|
serviceUrl | string | The URL of your Traque service endpoint | Yes |
apiKey | string | Your Traque API key | Yes |
environment | string | The environment name (e.g., 'PRODUCTION', 'DEVELOPMENT') | No |
release | string | The release version of your application | No |
debug | boolean | Enable debug mode for additional logging | No |
Next Steps
Once you have installed and set up the Traque React SDK, you can:
- Set up Error Boundaries to catch and report React component errors
- Use the useTraque hook for manual error reporting
- Configure additional error tracking features