You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@dfinity/identity

Package Overview
Dependencies
Maintainers
0
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/identity

JavaScript and TypeScript library to manage identity with the Internet Computer

3.1.0
latest
Source
npmnpm
Version published
Weekly downloads
168K
98.93%
Maintainers
0
Weekly downloads
 
Created

What is @dfinity/identity?

@dfinity/identity is an npm package that provides tools for managing identities and authentication in applications built on the Internet Computer. It allows developers to create and manage identities, sign messages, and interact with the Internet Computer's identity system.

What are @dfinity/identity's main functionalities?

Creating an Identity

This feature allows you to create a new identity using the Ed25519 key pair. The identity can be used for authentication and signing messages.

const { Ed25519KeyIdentity } = require('@dfinity/identity');
const identity = Ed25519KeyIdentity.generate();

Signing a Message

This feature demonstrates how to sign a message using an identity. The signed message can be used to verify the identity of the sender.

const { Ed25519KeyIdentity } = require('@dfinity/identity');
const identity = Ed25519KeyIdentity.generate();
const message = new TextEncoder().encode('Hello, Internet Computer!');
const signature = identity.sign(message);

Using an Identity with an Agent

This feature shows how to use an identity with an HttpAgent to interact with the Internet Computer. The agent uses the identity for authentication when making requests.

const { HttpAgent } = require('@dfinity/agent');
const { Ed25519KeyIdentity } = require('@dfinity/identity');
const identity = Ed25519KeyIdentity.generate();
const agent = new HttpAgent({ identity });

Other packages similar to @dfinity/identity

Keywords

internet computer

FAQs

Package last updated on 24 Jul 2025

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