react-huntglitch
v1.0.1
Published
A lightweight utility for sending error logs to HuntGlitch — supports both JS and TS.
Maintainers
Readme
🚀 Features
- 🔁 Centralized error logging with promise-based feedback
- 🧠 Intelligently categorizes logs by severity
- ⚙️ Supports custom log levels (
debug,info,warning,error, etc.) - ⚡ Quick setup via
.envkeys - 📦 Supports both JavaScript & TypeScript projects
- 🌐 Lightweight for client-side usage in React apps
- 🔐 Secure delivery via HuntGlitch keys
📦 Installation
npm install react-huntglitch⚙️ Environment Setup
Create a .env file in your project root:
PROJECT_KEY=your_project_key
DELIVERABLE_KEY=your_deliverable_key🔐 You can find these keys in your HuntGlitch dashboard:
https://app.huntglitch.com
✨ Usage
JavaScript / TypeScript
import Log from "react-huntglitch";
try {
throw new Error("Something went wrong!");
} catch (error) {
Log({
error,
logType: 5, // Optional, defaults to 5 (Error)
})
.then(() => console.log("✅ Log sent successfully."))
.catch(() => console.error("❌ Failed to send log."));
}📋 Props Reference
| Prop | Type | Required | Description | Example |
|------------|---------|----------|--------------------------------------------------------------------------|---------|
| error | object | ✅ | JavaScript error object to be logged | error |
| logType | number | ❌ | Log level: 1=debug, 2=warning, 3=notice, 4=info, 5=error | 5 |
🛠 Best Practices
- Wrap all async operations and business logic in
try...catchblocks. - Send contextual information (user IDs, request data, etc.) via enriched
Errorobjects. - Use different
logTypevalues to categorize errors for better filtering in HuntGlitch.
🙌 Special Thanks
Inspired by HuntGlitch — built to make error logging clean, centralized, and developer-friendly.
If you like this package, consider starring ⭐ the GitHub repo or sharing feedback!
📃 License
MIT © HuntGlitch
