Javascript
Two versions of DIDKit can be installed via
npm
, both under the organization "@spruceid":For example:
npm install @spruceid/didkit-wasm
.// Import the module
const DIDKit = require('@spruceid/didkit');
console.log(DIDKit.getVersion());
// To issue credentials and presentations, you need a key.
// The library provides a function to generate one.
const key = DIDKit.generateEd25519Key();
// There are two helpful functions to obtain a DID and the `did:key`
// `verificationMethod` from the key.
const did = DIDKit.keyToDID('key', key);
const verificationMethod = DIDKit.keyToVerificationMethod('key', key);
Last modified 1yr ago