This is an NPM package which provides some features like sending the slack notifications, custom exception handlers, class validators and much more..
- This is to provide a pre defined set of functions that can be used wherever needed
- To set up this NPM package on your node project, you'll need to follow this steps
First Install this package using
npm i @innofulfill/core-node-library
or
yarn add @innofulfill/core-node-library
- Configuration
There are some required env variable that needs to be set up on your project to use this package.
configure these env variables on your project
SLACK_TOKEN= - this will the slack token for your organiation
SLACK_CHANNEL_ID=. - this will be the channel's unique id.
- Use Case
Here's an example payload to send notifications in slack channels
sendSlackMessage({
title: 'Hello, world!',
details: {
message: 'Hello, world!',
method: 'GET',
url: 'https://example.com',
responseStatus: 200,
trace: {
key: 'domain',
value: 'example.com',
link: 'https://example.com',
},
},
metadata: {
user: 'John Doe',
},
trace: {
key: 'domain',
value: 'example.com',
link: 'https://example.com',
},
traces: [
{
key: 'domain',
value: 'example.com',
link: 'https://example.com',
},
],
threads: {
threadMessage: {
message: 'Hello, world!',
},
},
});
title - represents the title of the slack notifications (Bold in nature)
details - represents the basic details that will be visible in the block
metadata - represents the metadata informations (optional)
trace - represents the block including some kind of tracable links in it
traces - usefull in case of need to add multiple links in the payload
threads - represents the thread block, any data passed in this will be treated as thread message
In case of any questions or queries you can reach out to
- Repo owner or admin
- Other community or team contact