Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 604 Bytes

_quickstart-06-read-record.mdx

File metadata and controls

32 lines (22 loc) · 604 Bytes

3. Read DWN Records

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

Try it!