1.2.3 • Published 11 months ago

@martech/rewards-utils v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Tapit-BE-Utils

node-current Deploy

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

1.2.3

11 months ago

1.2.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago