@2060.io/credo-ts-didcomm-user-profile
v0.1.0
Published
DIDComm User Profile protocol extension module for Credo
Readme
Credo extension module for DIDComm User Profile protocol

Overview
The DIDComm User Profile extension module for Credo enables secure, decentralized sharing and updating of user profile information using DIDComm. It provides APIs, message handlers, and services to manage profile data between agents, including display name, profile picture, description, and preferred language.
Installation
npm install @2060.io/credo-ts-didcomm-user-profileUsage
Adding the Module to Your Agent
To use the User Profile module, add it to your agent's modules configuration:
import { DidCommUserProfileModule, UserProfileModuleConfig } from '@2060.io/credo-ts-didcomm-user-profile'
const agent = new Agent({
modules: {
// ...other modules
userProfile: new DidCommUserProfileModule(new UserProfileModuleConfig({ autoSendProfile: false })),
},
})Handling Profile Events
The module emits events when profile information should be updated or shared. Subscribe to these events to handle profile workflows in your application:
import { ProfileMessage } from '@2060.io/vs-agent-model'
const msg = JsonTransformer.fromJSON(message, ProfileMessage)
const { displayImageUrl, displayName, displayIconUrl, description, preferredLanguage } = msg
await agent.modules.userProfile.sendUserProfile({
connectionId: connection.id,
profileData: {
displayName: displayName ?? undefined,
displayPicture: displayImageUrl ? parsePictureData(displayImageUrl) : undefined,
displayIcon: displayIconUrl ? parsePictureData(displayIconUrl) : undefined,
description: description ?? undefined,
preferredLanguage: preferredLanguage ?? undefined,
},
})Features
- Profile Sharing: Share user profile information securely between agents.
- Profile Update: Update profile details such as display name, image, icon, description, and language.
- Event-Driven: React to profile update events for seamless integration.
- DIDComm Protocol: Uses DIDComm for secure, interoperable messaging.
API Reference
See the source code for details on available classes and methods:
DidCommUserProfileApi: Main API for profile operations.DidCommUserProfileService: Internal service for profile logic.DidCommUserProfileModule: Module integration for Credo agent.
Message Types
DidCommProfileMessageDidCommRequestProfileMessage
License
Apache 2.0
For more information, see the didcomm.org.
