Detecting the Provider

To detect if a user has already installed Broearn Wallet, a web application should check for the existence of a bw object. Browser extension and mobile in-app browser will both inject a bw object into the window of any web application the user visits.

If a bw object exists, PUT apps can interact with PUT via the API found at window.bw.put

If Broearn Wallet is not installed, we recommend you redirect your users to our website. Altogether, this may look like the following.

// Some code
const getProvider = () => {
  if ('bw' in window) {
    const provider = window.bw.put;

    return provider;
  }

  window.open('https://www.broearn.com', '_blank');
};

Last updated