@solucx/indicators
v1.3.1
Published
SoluCX Indicators
Downloads
437
Readme
SoluCX Indicators
This is a TypeScript library for calculating various customer satisfaction indicators. It includes support for NPS, CES, CSAT, CSAT10, NSS, LD, and NONE indicators.
Installation
To install this package, use the following command:
npm install @solucx/indicators
This is a private repository. You should be logged in into a allowed npm account or keep this authorized .npmrc credentials file at project or usr root folder.
Usage
Here's how you can use the indicators in your TypeScript code:
import Indicators, { Type } from '@solucx/indicators';
// Create an instance of a specific indicator
const npsIndicator = Indicators.getIndicator(Type.NPS);
// Calculate the score
const score = npsIndicator.getScore(positives, negatives, neutrals);
// Calculate the sampling error
const error = npsIndicator.getSamplingError(total, positives, negatives, neutrals);
You can replace Type.NPS with any other indicator type like Type.CSAT, Type.CES, etc. the available indicators are:
- CSAT
- CSAT10
- CES (depreciado)
- CES2
- LD
- NONE
- NSS
- NPS
the indicators shall follow the following rules:
- https://solucx.atlassian.net/wiki/spaces/SCX/pages/2053931009/Indicators
Test
To run the test suite use npm run test
Publish
To publish a new version of the SDK follow this steps:
npm version (major|minor|patch)
- major -> breaking changes
- minor -> non-breaking changes
- patch -> bugfixes
npm publish
- you have to logged in npm (
npm login
) - you should have access to the npm package (
https://www.npmjs.com/package/@solucx/indicators
)
- you have to logged in npm (
git push --tags