react-huntglitch
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-huntglitch

A lightweight and elegant utility for sending error logs to the HuntGlitch logging service — built for React apps with support for both JavaScript and TypeScript.

npm downloads license typescript


🚀 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 .env keys
  • 📦 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...catch blocks.
  • Send contextual information (user IDs, request data, etc.) via enriched Error objects.
  • Use different logType values 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

Package Sidebar

Install

npm i react-huntglitch

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

6.74 kB

Total Files

5

Last publish

Collaborators

  • huntglitch