1.0.3 • Published 6 months ago

@breadth.cloud/client v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

OptionTypeRequiredDefaultDescription
apiKeystringYes-Your Breadth.cloud API key
apiUrlstringNohttps://api.breadth.cloudCustom 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

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

7 months ago