npm.io
0.0.10 • Published 5 years ago

@affinityproject/affinity-metrics-lib

Licence
ISC
Version
0.0.10
Deps
2
Size
21 kB
Vulns
0
Weekly
0

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. 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.

Keywords