0.1.8 • Published 8 months ago

@bisontry/node-development v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Bisontry Node

Bisontry Node is a library that sends notifications to Slack when an error occurs.

🚀 Installation

Install the package using npm:

npm install @bisontry/node

📝 Usage

First, import the library and initialize it with your user configuration. This includes your Slack webhook URL for sending notifications.

import { bisontryInit, KlaytnNetwork, NodeEnv, OraklServiceName } from "@bisontry/node";

const userConfig = {
  MESSENGER_ENDPOINT: "" // Replace with bisontry messenger url.
  nodeEnv: NodeEnv.local // Change this according to your environment.
  network: KlaytnNetwork.baobab, // Change this according to your network.
  serviceName: OraklServiceName.test // Change this according to the service you are using.
};

const { BISONTRYLOGGER, bisontryHookConsoleError } = bisontryInit(userConfig);

Next, connect the console error hook:

bisontryHookConsoleError(BISONTRYLOGGER);
try {
  throw new Error('This is a test error');
} catch (error) {
  BISONTRYLOGGER.error({ name: 'main', error });
}

When you call the BISONTRYLOGGER.error method with an object containing additional details (like 'name'), it provides more precise information about the error. This information will be sent to Slack.

⚙️ Configuration

The userConfig object can define the following properties:

  • MESSENGER_ENDPOINT: The Bisontry Messenger URL.

If additional configurations are needed, modify the userConfig object passed to the bisontryInit function.

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago