
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@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
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.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.