@martech/rewards-utils
v1.2.3
Published
Utilitary package for logs
Downloads
1
Readme
Tapit-BE-Utils
Repoistory for the @martech/rewards-utils
package
Usage
Install the package from the npm repository
npm install @martech/rewards-utils
Logging
In the application, initialize the log configuration:
const { Logging } = require('@martech/rewards-utils')
// send the AWS context with the requestId
Logging.init(context)
Use one of the following functions to log events:
/**
* first param is the message
* second its the object to log
* third is an array of tags
*/
Logging.info('some message', {}, [])
Logging.warn('some message', {}, [])
Logging.error('some message', {}, [])
Feature Flag validation
You can validate a previously created backend feature flag using FeatureFlag
module
Example:
const { FeatureFlag } = require('@martech/rewards-utils')
// validate a feature flag by name
const isActiveFlag = await FeatureFlag.validateFeatureFlag('my_flag')
if (isActiveFlag) {
// Do something....
}
Contribution
Create a PR on the repo and once it's release the changes will be published on the npm repository by a github action