Skip to content

didcomm-react-native 0.0.2

Install from the command line:
Learn more about npm packages
$ npm install @sicpa-dlab/didcomm-react-native@0.0.2
Install via package.json:
"@sicpa-dlab/didcomm-react-native": "0.0.2"

About this version

DIDComm React Native

License

Basic DIDComm v2 support for React Native framework (Android only).

Under the hood

This package is React Native wrapper for DIDComm JVM library. It contains native modules that are using DIDComm JVM API and exposes Javascript/Typescript API using React Native bridge.

Usage

Create .npmrc file with following content to be able to install package from GitHub registry:

@sicpa-dlab:registry=https://npm.pkg.github.com

Add following DIDComm resolvers initialization code to your App (it's a workaround that will be removed later):

import { NativeModules, NativeEventEmitter } from 'react-native'
import { useEffect } from 'react'
import { DIDCommResolversProxy } from "@sicpa-dlab/didcomm-react-native"

const { DIDCommResolversProxyModule } = NativeModules

export default function App() {

    useEffect(() => {
        const nativeEventEmitter = new NativeEventEmitter(DIDCommResolversProxyModule)
        DIDCommResolversProxy.start(nativeEventEmitter)
        return () => DIDCommResolversProxy.stop()
    },[])
    

    return ...
}

A general usage of the API is the following:

  • Sender Side:
    • Build a Message (plaintext, payload).
    • Convert a message to a DIDComm Message for further transporting by calling one of the following:
      • Message.pack_encrypted to build an Encrypted DIDComm message
      • [To be implemented] Message.pack_signed to build a Signed DIDComm message
      • [To be implemented] Message.pack_plaintext to build a Plaintext DIDComm message
  • Receiver side:
    • Call Message.unpack on receiver side that will decrypt the message, verify signature if needed and return a Message for further processing on the application level.

Run demo

cd ./demo
yarn install
yarn android

Publishing new version

If you have write access to the repo, you can publish new version using following steps:

  • Create GitHub Personal access token with full repo and write:packages scopes if you don't have one
  • Run npm login --registry=https://npm.pkg.github.com command and log-in using your access token as a password
  • Run npm publish command from the repo root

Details


Assets

  • didcomm-react-native-0.0.2-npm.tgz

Download activity

  • Total downloads 34
  • Last 30 days 0
  • Last week 0
  • Today 0