src/docs/src/Apps/delete.md
Deletes an app with the given name.
puter.apps.delete(name)
name (required)The name of the app to delete.
A Promise that will resolve to an object { success: true } indicating whether the deletion was successful.
<strong class="example-title">Create a random app then delete it</strong>
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
// (1) Generate a random app name to make sure it doesn't already exist
let appName = puter.randName();
// (2) Create the app
await puter.apps.create(appName, "https://example.com");
puter.print(`"${appName}" created
`);
// (3) Delete the app
await puter.apps.delete(appName);
puter.print(`"${appName}" deleted
`);
// (4) Try to retrieve the app (should fail)
puter.print(`Trying to retrieve "${appName}"...
`);
try {
await puter.apps.get(appName);
} catch (e) {
puter.print(`"${appName}" could not be retrieved
`);
}
})();
</script>
</body>
</html>