@breadth.cloud/client
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Breadth Client

JavaScript error tracking client for Breadth.cloud.

Installation

npm install @breadth.cloud/client
# or
yarn add @breadth.cloud/client
# or
pnpm add @breadth.cloud/client

Usage

Quick Setup

You can use our setup script to quickly configure Breadth in your project:

# After installing the package
npx breadth-setup

This interactive script will:

  1. Ask for your API key
  2. Let you select your project type
  3. Create a configuration file with the proper setup
  4. Provide next steps for integration

Manual Setup

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

Advanced Configuration

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
});

Manual Error Tracking

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');

Features

  • 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)

Configuration Options

Option Type Required Default Description
apiKey string Yes - Your Breadth.cloud API key
apiUrl string No https://api.breadth.cloud Custom API endpoint URL

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 11+
  • Edge 79+
  • Opera 47+
  • iOS Safari 11+
  • Android Browser 76+

Local Development

For instructions on how to use this package during local development, see LOCAL_DEVELOPMENT.md.

License

MIT

Package Sidebar

Install

npm i @breadth.cloud/client

Weekly Downloads

15

Version

1.0.3

License

MIT

Unpacked Size

39.5 kB

Total Files

13

Last publish

Collaborators

  • gamerweazel