Skip to main content

Delete Data from a Decentralized Web Node

Before deleting from your Decentralized Web Node (DWN), be sure to check out our Quickstart guide to ensure you’ve properly imported the Web5 SDK. Additionally, make sure you’ve set up a DID before attempting to delete from a DWN.

Deleting from a DWN

The following snippet allows you to delete from your Web5 instance’s DWN:

// Create the record
const { record } = await web5.dwn.records.create({
data: "Hello Web5",
message: {
dataFormat: 'text/plain',
},
});
// Delete the record
const deleteResult = await record.delete();

Was this page helpful?

Connect with us on Discord

Submit feedback: Open a GitHub issue

Edit this page: GitHub Repo

Contribute: Contributing Guide