Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@affinidi/affinity-metrics-lib

Package Overview
Dependencies
Maintainers
8
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@affinidi/affinity-metrics-lib

Client to work with Affinidi Metrics backend

latest
Source
npmnpm
Version
1.2.2
Version published
Maintainers
8
Created
Source

Affinidi Metrics Client (PUBLIC)

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, EventName, EventCategory, EventComponent} from '@affinidi/affinity-metrics-lib'

const event = {
  link:        'any_relevant_unique_id_will_be_hashed',
  name:        EventName.DID_CREATED,
  category:    EventCategory.DID,
  subCategory: 'registry',
  component:   EventComponent.AffinidiRegistry,
}

metrics.send(event, apiKeyHash, metricsUrl)

Parameters

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

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

Setup Integration Tests

Test API key hash should be added to the top level .env file. Reach out to a team member for instructions on how to set up this file, or to obtain a copy.

Events

Metrics EventDescription (When Does It Happen)Note
USER_ONBOARDEDA developer has signed up for an API key.https://affinity-onboarding-frontend.dev.affinity-project.org/
DID_CREATEDA DID has been created.
DID_UPDATEDA DID has been updated.
VC_VERIFIEDA VC has been verified.VC holder as the link.
VC_VERIFIED_PER_PARTYA VC has been verified.VC verifier as the link.
VC_SAVEDA VC has been stored in a wallet.VC ID as the link and issuer ID as the secondary link.
VC_SIGNEDA VC has been signed.VC holder as the link.
VC_REVOKEDA VC has been revoked.Issuer DID as the link.
VC_ISSUE_INITIATEDA VC issue has been initiated.VC ID as the link and issuer ID as the secondary link.
SHARED_MESSAGE_CREATEDA VC has been shared as shared message.VC ID as the link and issuer ID as the secondary link.
VP_VERIFIEDA VP has been verified.VP holder as the link.
VP_SIGNEDA VP has been signed.VP holder as the link and VP ID as the secondary link.
VP_VERIFIED_JWTA VP has been verified in JWT format.VP holder as the link.
VP_SIGNED_JWTA VP has been signed in JWT format.VP holder as the link and VP ID as the secondary link.

Keywords

sdk

FAQs

Package last updated on 07 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts