The Apps API allows you to create, manage, and interact with applications in the Puter ecosystem. You can build and deploy applications that integrate seamlessly with Puter's platform.
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
// (1) Generate a random app name
let appName = puter.randName();
// (2) Create the app and prints its UID to the page
let app = await puter.apps.create(appName, "https://example.com");
puter.print(`Created app "${app.name}". UID: ${app.uid}`);
// (3) Delete the app (cleanup)
await puter.apps.delete(appName);
})();
</script>
</body>
</html>
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
(async () => {
// (1) Generate 3 random app names
let appName_1 = puter.randName();
let appName_2 = puter.randName();
let appName_3 = puter.randName();
// (2) Create 3 apps
await puter.apps.create(appName_1, 'https://example.com');
await puter.apps.create(appName_2, 'https://example.com');
await puter.apps.create(appName_3, 'https://example.com');
// (3) Get all apps (list)
let apps = await puter.apps.list();
// (4) Display the names of the apps
puter.print(JSON.stringify(apps.map(app => app.name)));
// (5) Delete the 3 apps we created earlier (cleanup)
await puter.apps.delete(appName_1);
await puter.apps.delete(appName_2);
await puter.apps.delete(appName_3);
})();
</script>
</body>
</html>
<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<br>`);
// (3) Delete the app
await puter.apps.delete(appName);
puter.print(`"${appName}" deleted<br>`);
// (4) Try to retrieve the app (should fail)
puter.print(`Trying to retrieve "${appName}"...<br>`);
try {
await puter.apps.get(appName);
} catch (e) {
puter.print(`"${appName}" could not be retrieved<br>`);
}
})();
</script>
</body>
</html>
<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>
<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<br>`);
// (3) Retrieve the app using get()
let app = await puter.apps.get(appName);
puter.print(`"${appName}" retrieved using get(): id: ${app.uid}<br>`);
// (4) Delete the app (cleanup)
await puter.apps.delete(appName);
})();
</script>
</body>
</html>
These Apps API are supported out of the box when using Puter.js:
puter.apps.create()
- Create a new applicationputer.apps.list()
- List all applicationsputer.apps.delete()
- Delete an applicationputer.apps.update()
- Update application settingsputer.apps.get()
- Get information about a specific applicationYou can see various Puter.js Apps API in action from the following examples: