JavaScript error tracking client for Breadth.cloud.
npm install @breadth.cloud/client
# or
yarn add @breadth.cloud/client
# or
pnpm add @breadth.cloud/client
You can use our setup script to quickly configure Breadth in your project:
# After installing the package
npx breadth-setup
This interactive script will:
- Ask for your API key
- Let you select your project type
- Create a configuration file with the proper setup
- Provide next steps for integration
import Breadth from '@breadth.cloud/client';
// Initialize with your API key
const errorTracker = new Breadth({
apiKey: 'your-api-key'
});
// That's it! Errors will be automatically captured
import Breadth from '@breadth.cloud/client';
// Initialize with custom configuration
const errorTracker = new Breadth({
apiKey: 'your-api-key',
apiUrl: 'https://your-custom-breadth-instance.com' // Optional: custom API endpoint
});
In addition to automatic error capturing, you can manually track errors:
try {
// Your code that might throw an error
riskyOperation();
} catch (error) {
// Manually track the caught error
errorTracker.trackError(error);
}
// You can also track custom error messages
errorTracker.trackError('Something went wrong with the payment process');
- Automatic capture of uncaught exceptions
- Unhandled promise rejection tracking
- Anonymous client identification
- Minimal performance impact
- TypeScript support
- Works in both browser and Node.js environments (with appropriate polyfills)
Option | Type | Required | Default | Description |
---|---|---|---|---|
apiKey | string | Yes | - | Your Breadth.cloud API key |
apiUrl | string | No | https://api.breadth.cloud | Custom API endpoint URL |
- Chrome 60+
- Firefox 55+
- Safari 11+
- Edge 79+
- Opera 47+
- iOS Safari 11+
- Android Browser 76+
For instructions on how to use this package during local development, see LOCAL_DEVELOPMENT.md.
MIT