mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-26 23:19:29 -06:00
`puter.exit()` now takes a status code, similar to the exit status on desktop OSes. This is passed to the appClosed event, so that eg a parent app can know whether its child app ran successfully.
Puter.js
The official JavaScript SDK for Puter.com. Cloud and AI features right from your frontend code!
« LIVE DEMO »
Docs
·
Puter.com
·
Discord
·
Reddit
·
X (Twitter)
Example
Make sure the development server is running.
<html>
<body>
<script src="http://puter.localhost:4100/sdk/puter.dev.js"></script>
<script>
// Loading ...
puter.print(`Loading...`);
// Chat with GPT-3.5 Turbo
puter.ai.chat(`What color was Napoleon's white horse?`).then((response) => {
puter.print(response);
});
</script>
</body>
</html>