Installing the ID DWN SDK
The entire ID DWN library is available on npmjs.com To install the library, simply run either:
npm i @dwn-protocol/dwn
or
yarn add @dwn-protocol/dwn
Instantiate the DWN from the SDK
import { IDDwn } from './browser.mjs'; // browser version only
// OR
import { IDDwn } from '@dwn-protocol/dwn'; // node version
let idDwn = new IDDwn;Create a decentralized identity (DID)
const did = await idDwn.did.create('ion');Store the DID
await idDwn.did.manager.set(did.id, {
connected: true,
endpoint: 'app://dwn',
keys: {
['#dwn']:
{
keyPair: did.keys.find(key => key.id === 'dwn').keyPair,
},
},
});Create some data
Read the data
Update the data
Delete the data
Last updated
