Detecting the Provider

To detect if a Elli Wallet is installed in a user's browser, you need to check if window.elli is defined. The Elli Wallet extension injects elli into the browser's window object and it's available to all web pages on the user's browser.

const isElliInstalled = window.elli && window.elli.isElli;

If Elli Wallet is not installed, you can prompt and redirect your users to download it using something like this:

const getProvider = () => {
  if ('elli' in window) {
    const provider = window.elli;
    if (provider.isElli) {
      return provider;
    }
  }
  window.open('https://elliwallet.com', '_blank');
};

Last updated