Nachos Preventing Motivation
Have ideas to improve npm?Join in the discussion! »

@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

  • event - tacking event
  • apiKeyhash - hash from your application key used for service 2 service communication.
  • metricsUrl - optional url of metric service https://affinity-metrics.[env].affinity-project.org

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.

Install

npm i @affinityproject/affinity-metrics-lib

DownloadsWeekly Downloads

5

Version

0.0.10

License

ISC

Unpacked Size

21.2 kB

Total Files

26

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar