webUPI.enable()

To begin interacting with WebUPI APIs you'll first need to enable the provider. Calling webUPI.enable() will prompt the user for permission to use the WebUPI capabilities of the browser. After that, you are free to call any of the other API methods.

Method


async function enable(): void;

Example


try {
  if (typeof window.webUPI !== 'undefined') {
    await window.webUPI.enable();
  }
}
catch (error) {
  // User denied permission or cancelled
  console.log(error);
}

Last updated