If the user has given your app read permissions to their DWN, you can read their data by accessing it through the record
property.
To return the text data stored in the record
, add the following to index.js
:
const readResult = await record.data.text();
Test your code
To see the record that was read from the DWN, add the following to index.js
:
console.log('readResult', readResult)
The output will resemble:
Hello Web5