puter.env
A property of the puter
object that returns the environment in which Puter.js is being used.
puter.env
A string containing the environment in which Puter.js is being used:
app
- Puter.js is running inside a Puter application. e.g. https://puter.com/app/editor
web
- Puter.js is running inside a web page outside of the Puter environment. e.g. https://example.com/index.html
gui
- Puter.js is running inside the Puter GUI. e.g. https://puter.com/
Get the environment in which Puter.js is running
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.print("Environment: " + puter.env);
</script>
</body>
</html>