puter.apps.update()

Websites Puter Apps Node.js Workers

Updates attributes of the app with the given name.

Syntax

puter.apps.update(name, attributes)

Parameters

name (required)

The name of the app to update.

attributes (required)

An object containing the attributes to update. The object can contain the following properties:

Option Type Description
title String The new title of the app.
indexURL String The new URL of the app's index page. This URL must be accessible to the user.
description String The new description of the app aimed at the end user.
icon String The new icon of the app.
name String The new name of the app. App names are unique across all Puter accounts. If any app already has this name, the promise will be rejected.
filetypeAssociations Array<String> An array of strings representing the filetypes that the app can open. Defaults to []. File extensions and MIME types are supported. For example, [".txt", ".md", "application/pdf"] would allow the app to open .txt, .md, and PDF files. At most 200 entries, each at most 60 characters.
maximizeOnStart Boolean Whether the app should be maximized when it is started. Defaults to false.
background Boolean Whether the app should run in the background. Defaults to false.
feedbackEnabled Boolean Whether users can send feedback to you through puter.ui.showFeedbackDialog(). Omitted leaves the app's current value unchanged.
metadata Object An object containing custom metadata for the app. This can be used to store arbitrary key-value pairs associated with the app. At most 16 KiB when serialized as JSON.

Changing indexURL can merge the app into an existing app for that hosted origin. The returned app can have a different UID. The deleted source app's KV data and KV shares are removed. Data already belonging to the surviving app is retained.

Return value

A Promise that will resolve to the App object that was updated.

Examples

Create a random app then change its title

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        (async () => {
            // (1) Create a random app
            let appName = puter.randName();
            await puter.apps.create(appName, "https://example.com")
            puter.print(`"${appName}" created<br>`);

            // (2) Update the app
            let updated_app = await puter.apps.update(appName, {title: "My Updated Test App!"})
            puter.print(`Changed title to "${updated_app.title}"<br>`);

            // (3) Delete the app (cleanup)
            await puter.apps.delete(appName)
        })();
    </script>
</body>
</html>