@affinityproject/affinity-metrics-lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

Affinity metrics client

For security reasons we hash a link before sending it over the network. In a most cases link should be any relevant id that could help with a tracking. :caution: Strongly avoid passing any ppi or sensitive data in a subcategory fields.

Usage:

import { metrics, EventCategory, EventComponent} from '@affinityproject/affinity-metrics-lib'

const event = {
  link:        'any_relevant_unique_id_will_be_hashed',
  name:        'Did Created',
  category:    EventCategory.DID,
  subCategory: 'registry',
  component:   EventComponent.AffinityWalletExpoSDK
}

metrics.send(event, 'a1870180fca44ea69633797fd1643f1287452043fcac23a5fb7d944abf8d1f0e', metricsUrl)

Parameters

EventComponent and EventCategory are predefined library level enums, in case you need to add a new component or category do it via PR. Try to keep the category as generic as possible.

Readme

Keywords

Package Sidebar

Install

npm i @affinityproject/affinity-metrics-lib

Weekly Downloads

11

Version

0.0.10

License

ISC

Unpacked Size

21.2 kB

Total Files

26

Last publish

Collaborators

  • standemchuk