> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phantom.com/llms.txt
> Use this file to discover all available pages before exploring further.

> To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.

# Detect the provider

<Warning>
  **The `window.phantom.bitcoin` provider has been deprecated.**
</Warning>

Phantom's browser extension and mobile in-app browser will both inject a `phantom` object into the [window](https://developer.mozilla.org/en-US/docs/Web/API/Window) of any web application the user visits, provided that site is using `https://`, on `localhost`, or is `127.0.0.1`. Phantom will not inject the provider into [iframes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) or sites using `http://`.

If a `phantom` object exists, Bitcoin and Ordinals dapps can interact with Phantom via the API found at `window.phantom.bitcoin`. To detect if Phantom is installed, an application should check for an additional `isPhantom` flag like so:

```typescript theme={null}
const isPhantomInstalled = window?.phantom?.bitcoin?.isPhantom
```

If Phantom is not installed, we recommend you redirect your users to our website `https://phantom.com/`. Altogether, this may look like the following:

```typescript theme={null}
const getProvider = () => {
  if ('phantom' in window) {
    const anyWindow: any = window;
    const provider = anyWindow.phantom?.bitcoin;
   
    if (provider && provider.isPhantom) {
      return provider;
    }
  }

  window.open('https://phantom.com/', '_blank');
};
```

When adding a Phantom button to your dapp’s wallet modal, we recommend using the name “Phantom” with an SVG/PNG icon, which you can find in [Logos and assets](/resources/assets).

<img src="https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?fit=max&auto=format&n=fkWrmnMWhjoXSGZ9&q=85&s=055eadb4f6f1a8e1370c974c80b65c2f" alt="An example Phantom button in a wallet modal" width="2000" height="403" data-path="bitcoin/images/phantom-modal-button.png" />
