@2060.io/credo-ts-didcomm-media-sharing
v0.0.6
Published
DIDComm Media sharing protocol implementation for credo-ts
Downloads
747
Readme
Overview
The Media Sharing extension module for Credo enables agents to securely exchange media files (images, audio, video, documents) using DIDComm protocols. It supports encrypted transmission, rich metadata, and event-driven workflows for handling shared media.
Installation
npm install @2060.io/credo-ts-didcomm-media-sharingUsage
Adding the Module to Your Agent
To use the Media Sharing module, add it to your agent's modules configuration:
import { MediaSharingModule } from '@2060.io/credo-ts-didcomm-media-sharing'
const agent = new Agent({
modules: {
// ...other modules
media: new MediaSharingModule(),
},
})Create Media
Create media sharing events to process media record:
// Create media record entry
const newRecord = await agent.modules.media.create({
connectionId: connection.id,
items: [item],
metadata: { ...originalRecord.metadata },
description: originalRecord.description,
})Sending a media file

Receiving a media file

Encryption and Security
Media items can be transmitted with encryption. The ciphering property in each media item describes the encryption method and keys used. This ensures that only authorized recipients can access the shared files.
Features
- Secure Media Exchange: Send and receive encrypted media files over DIDComm.
- Rich Metadata Support: Share media with metadata such as preview, duration, dimensions, and more.
- Event Subscription: Listen for media sharing events to trigger workflows or update UI.
- Protocol Integration: Seamless integration with Credo agent and DIDComm protocols.
API Reference
See the source code for details on available classes and methods:
MediaSharingApi: Main API for sending and receiving media.MediaSharingModule: Module integration for Credo agent.MediaSharingEvents: Event types and payloads.
License
Apache 2.0
For more information, see the didcomm.org.
