telemetry 1.0.37
Install from the command line:
Learn more about npm packages
$ npm install @harness/telemetry@1.0.37
Install via package.json:
"@harness/telemetry": "1.0.37"
About this version
This package provides an abstraction for front end telemetry frameworks. Currently, this abstracts the Segment package. This allows consumers to avoid implementing and duplicating their own analytics methods and use a common package. In the future, if Segment is not used in favour of another analytics framework, it will be easy to change the contents of this abstraction rather than asking all consumers to change their code.
- Install the dependencies
$ yarn
- Add the package to your repo
yarn add file:./../harness-telemetry // The path to your repo
- Follow the steps in "Using this package"
- Install the package in your repository
$ yarn add @harness/telemetry
- Initialize the Telemetry package at the entry point of your app and save it in a local file.
// your_app/src/Telemetry.ts
import Telemetry from '@harness/Telemetry'
const telemetry = new Telemetry(YOUR_WRITE_KEY)
export default telemetry;
- (OPTIONAL) Set the accountId.
// your_app/src/Telemetry.ts
import telemetry from './Telemetry'
telemetry.accountId = THE_ACCOUNT_ID
- Use the telemetry instance to call analytics methods.
import telemetry from './Telemetry'
telemetry.track("signup", { email })
- Submit a PR and bump the version number in package.json
- Run the jenkins job
The jenkins job will publish a new version to our npm registry.