puter.ui.authenticateWithPuter()Presents a dialog to the user to authenticate with their Puter account.
puter.ui.authenticateWithPuter()
None.
A Promise that resolves once the user is authenticated with their Puter account. If the user cancels the dialog, the promise will be rejected with an error.
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
// Presents a dialog to the user to authenticate with their Puter account.
puter.ui
.authenticateWithPuter()
.then(() => {
console.log("Authentication success!");
})
.catch((error) => {
console.error("Authentication failed: ", error);
});
</script>
</body>
</html>