
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@affinidi/affinity-metrics-lib
Advanced tools
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.
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 eventapiKeyhash - hash from your application key used for service 2 service communicationmetricsUrl - optional url of metrics service https://affinity-metrics.[env].affinity-project.orgEventName, 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.
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.
| Metrics Event | Description (When Does It Happen) | Note |
|---|---|---|
USER_ONBOARDED | A developer has signed up for an API key. | https://affinity-onboarding-frontend.dev.affinity-project.org/ |
DID_CREATED | A DID has been created. | |
DID_UPDATED | A DID has been updated. | |
VC_VERIFIED | A VC has been verified. | VC holder as the link. |
VC_VERIFIED_PER_PARTY | A VC has been verified. | VC verifier as the link. |
VC_SAVED | A VC has been stored in a wallet. | VC ID as the link and issuer ID as the secondary link. |
VC_SIGNED | A VC has been signed. | VC holder as the link. |
VC_REVOKED | A VC has been revoked. | Issuer DID as the link. |
VC_ISSUE_INITIATED | A VC issue has been initiated. | VC ID as the link and issuer ID as the secondary link. |
SHARED_MESSAGE_CREATED | A VC has been shared as shared message. | VC ID as the link and issuer ID as the secondary link. |
VP_VERIFIED | A VP has been verified. | VP holder as the link. |
VP_SIGNED | A VP has been signed. | VP holder as the link and VP ID as the secondary link. |
VP_VERIFIED_JWT | A VP has been verified in JWT format. | VP holder as the link. |
VP_SIGNED_JWT | A VP has been signed in JWT format. | VP holder as the link and VP ID as the secondary link. |
FAQs
Client to work with Affinidi Metrics backend
The npm package @affinidi/affinity-metrics-lib receives a total of 140 weekly downloads. As such, @affinidi/affinity-metrics-lib popularity was classified as not popular.
We found that @affinidi/affinity-metrics-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.