@hymns/alertiqo
v1.0.0
Published
Alertiqo SDK for browser error tracking
Maintainers
Readme
Alertiqo JavaScript SDK
Client-side SDK for error tracking in web/browser applications.
Installation
npm install @hymns/alertiqoUsage
Basic Setup
import Alertiqo from '@hymns/alertiqo';
const alertiqo = new Alertiqo({
apiKey: 'your-api-key',
endpoint: 'https://alertiqo.hamizi.net',
environment: 'production',
release: '1.0.0',
});
alertiqo.init();Capture Exceptions
try {
throw new Error('Something went wrong');
} catch (error) {
alertiqo.captureException(error);
}Capture Messages
alertiqo.captureMessage('User completed checkout', 'info');Add Breadcrumbs
alertiqo.addBreadcrumb({
message: 'User clicked button',
category: 'user-action',
level: 'info',
data: { buttonId: 'submit-btn' }
});Set User Context
alertiqo.setUser({
id: '12345',
email: '[email protected]',
username: 'johndoe'
});Set Tags
alertiqo.setTag('page', 'checkout');
alertiqo.setTags({
feature: 'payments',
version: '2.1.0'
});API
new Alertiqo(config)
Creates a new Alertiqo instance.
Config Options:
apiKey(required): Your API keyendpoint(required): Backend endpoint URLenvironment: Environment name (default: 'production')release: Release versiontags: Default tags for all errorsbeforeSend: Callback to modify/filter errors before sending
Methods
init(): Initialize error handlerscaptureException(error, additionalData?): Capture an exceptioncaptureMessage(message, level?): Capture a messageaddBreadcrumb(breadcrumb): Add a breadcrumbsetUser(user): Set user contextsetTag(key, value): Set a single tagsetTags(tags): Set multiple tags
