To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.
The window.phantom.bitcoin provider has been deprecated.
Phantom’s browser extension and mobile in-app browser will both inject a phantom object into the 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 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:
If Phantom is not installed, we recommend you redirect your users to our website https://phantom.com/. Altogether, this may look like the following:
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.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Phantom developer documentation","description":"Phantom is a crypto wallet that can be used to manage digital assets and access decentralized apps on multiple blockchains.","colors":{"primary":"#AB9FF2","light":"#AB9FF2","dark":"#AB9FF2"},"logo":{"light":"https://mintcdn.com/phantom-e50e2e68/tU9g5MXFXgx4l6Em/logo/phantom-light.svg?fit=max\u0026auto=format\u0026n=tU9g5MXFXgx4l6Em\u0026q=85\u0026s=e900bab5ae2cffa45148551c3678ce46","dark":"https://mintcdn.com/phantom-e50e2e68/tU9g5MXFXgx4l6Em/logo/phantom-dark.svg?fit=max\u0026auto=format\u0026n=tU9g5MXFXgx4l6Em\u0026q=85\u0026s=eff6d20e74e8315e9c4a8deb0cf9da15"},"favicon":"https://mintcdn.com/phantom-e50e2e68/tU9g5MXFXgx4l6Em/favicon.svg?fit=max\u0026auto=format\u0026n=tU9g5MXFXgx4l6Em\u0026q=85\u0026s=c951a8095deaeea8c05a37884471cede","background":{"color":{"dark":"#202020"}},"navbar":{"links":[{"href":"https://docs.google.com/forms/d/e/1FAIpQLSeHWETFkEJbHQCF-lnl1AHmVQPuyfC0HbnxjDjIp6VYV1sBZQ/viewform","label":"Support"}],"primary":{"type":"button","label":"Download Phantom","href":"https://phantom.app/download"}},"footer":{"socials":{"website":"https://phantom.com","github":"https://github.com/phantom"}},"errors":{"404":{"redirect":false,"title":"Page Not Found","description":"The page you're looking for may have been moved, renamed, or doesn't exist. Here are some helpful resources:\n\n\u003cCardGroup cols={2}>\n \u003cCard title=\"Introduction\" icon=\"book-open\" href=\"/introduction\">\n Start here to learn about Phantom wallet integration\n \u003c/Card>\n \u003cCard title=\"Phantom Connect\" icon=\"link\" href=\"/phantom-connect\">\n Enable users to connect using Social Login or browser extension\n \u003c/Card>\n \u003cCard title=\"SDK Overview\" icon=\"code\" href=\"/wallet-sdks-overview\">\n Choose the right SDK for your application\n \u003c/Card>\n \u003cCard title=\"FAQ\" icon=\"circle-question\" href=\"/resources/faq\">\n Find answers to common questions\n \u003c/Card>\n \u003cCard title=\"Support\" icon=\"life-ring\" href=\"https://docs.google.com/forms/d/e/1FAIpQLSeHWETFkEJbHQCF-lnl1AHmVQPuyfC0HbnxjDjIp6VYV1sBZQ/viewform\">\n Get help from our developer support team\n \u003c/Card>\n\u003c/CardGroup>"}},"contextual":{"options":["claude","copy","view","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Announcements","icon":"telegram","href":"https://t.me/+R0vUw_QWSO9lNjlh"},{"anchor":"Support","icon":"life-ring","href":"https://docs.google.com/forms/d/e/1FAIpQLSeHWETFkEJbHQCF-lnl1AHmVQPuyfC0HbnxjDjIp6VYV1sBZQ/viewform"},{"anchor":"GitHub","icon":"github","href":"https://github.com/phantom"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"phantom-e50e2e68","hasAudioNarration":false,"actualSubdomain":"phantom-e50e2e68","customDomains":["docs.phantom.com"],"gitSource":{"type":"github","owner":"phantom","repo":"docs-v2","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED","enabled":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af9f1de50cc0037d87283a6","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Developer tools and resources","count":79},{"language":"default","tag":"Traditional Provider","count":37},{"language":"default","tag":"Phantom Connect SDKs","count":23},{"language":"default","tag":"Recipes","count":23},{"language":"default","tag":"EVM networks","count":19},{"language":"default","tag":"Mobile Deep Links","count":16},{"language":"default","tag":"Provider API Reference","count":14},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Overview","count":9},{"language":"default","tag":"Phantom Portal","count":8}]},"assistantConfig":{"enableStarterQuestions":false},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"bitcoin/detecting-the-provider","slug":"/bitcoin/detecting-the-provider","pageMetadata":{"description":"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.","title":"Detect the provider","href":"/bitcoin/detecting-the-provider"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,OptimizedImage,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Warning,{children:_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`The `,_jsx(_components.code,{children:`window.phantom.bitcoin`}),` provider has been deprecated.`]})})}),`\n`,_jsxs(_components.p,{children:[`Phantom’s browser extension and mobile in-app browser will both inject a `,_jsx(_components.code,{children:`phantom`}),` object into the `,_jsx(_components.a,{href:`https://developer.mozilla.org/en-US/docs/Web/API/Window`,children:`window`}),` of any web application the user visits, provided that site is using `,_jsx(_components.code,{children:`https://`}),`, on `,_jsx(_components.code,{children:`localhost`}),`, or is `,_jsx(_components.code,{children:`127.0.0.1`}),`. Phantom will not inject the provider into `,_jsx(_components.a,{href:`https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe`,children:`iframes`}),` or sites using `,_jsx(_components.code,{children:`http://`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`If a `,_jsx(_components.code,{children:`phantom`}),` object exists, Bitcoin and Ordinals dapps can interact with Phantom via the API found at `,_jsx(_components.code,{children:`window.phantom.bitcoin`}),`. To detect if Phantom is installed, an application should check for an additional `,_jsx(_components.code,{children:`isPhantom`}),` flag like so:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` isPhantomInstalled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`phantom`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bitcoin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isPhantom`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If Phantom is not installed, we recommend you redirect your users to our website `,_jsx(_components.code,{children:`https://phantom.com/`}),`. Altogether, this may look like the following:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getProvider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'phantom'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` anyWindow`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` any`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` provider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` anyWindow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`phantom`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bitcoin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provider`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isPhantom`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://phantom.com/'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'_blank'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`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 `,_jsx(_components.a,{href:`/resources/assets`,children:`Logos and assets`}),`.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=055eadb4f6f1a8e1370c974c80b65c2f`,alt:`An example Phantom button in a wallet modal`,\"data-og-width\":`2000`,width:`2000`,\"data-og-height\":`403`,height:`403`,\"data-path\":`bitcoin/images/phantom-modal-button.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=280\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=f897c266486d50513b18b7eb8564fd28 280w, https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=560\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=23363497cb924ad0a6d2d6f124cbcaed 560w, https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=840\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=8f3eb952e474abb262ee8f67787d6641 840w, https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=1100\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=65e8f247d1cfeaaaa8dc1e45ed1a6d07 1100w, https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=1650\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=90eb9afd7a0e20bcd9b18ecf8668fac8 1650w, https://mintcdn.com/phantom-e50e2e68/fkWrmnMWhjoXSGZ9/bitcoin/images/phantom-modal-button.png?w=2500\u0026fit=max\u0026auto=format\u0026n=fkWrmnMWhjoXSGZ9\u0026q=85\u0026s=0e580d6d1ce5ebed8d7a1e771099bff9 2500w`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"description":"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.","title":"Detect the provider","href":"/bitcoin/detecting-the-provider"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/phantom-e50e2e68/f7f937fb83d93950/analytics.js"],"subdomain":"phantom-e50e2e68","siteName":"Phantom developer documentation","title":"Detect the provider - Phantom developer documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-17T19:10:09.945Z","originalFileLocation":"bitcoin/detecting-the-provider.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Phantom developer documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Detect the provider - Phantom developer documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Phantom developer documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.phantom.com/bitcoin/detecting-the-provider\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://phantom-e50e2e68.mintlify.site/_mintlify/api/og/v2?division=Bitcoin\u0026amp;title=Detect+the+provider\u0026amp;description=To+detect+if+a+user+has+already+installed+Phantom%2C+a+web+application+should+check+for+the+existence+of+a+phantom+object.\u0026amp;theme=5265053dc1d774e2df120e48\u0026amp;signature=292b53ac4f43ddeff6cfadcf89f6266984e47cf10be5c30904ee8e3667de74b2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Detect the provider - Phantom developer documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://phantom-e50e2e68.mintlify.site/_mintlify/api/og/v2?division=Bitcoin\u0026amp;title=Detect+the+provider\u0026amp;description=To+detect+if+a+user+has+already+installed+Phantom%2C+a+web+application+should+check+for+the+existence+of+a+phantom+object.\u0026amp;theme=5265053dc1d774e2df120e48\u0026amp;signature=292b53ac4f43ddeff6cfadcf89f6266984e47cf10be5c30904ee8e3667de74b2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/phantom-e50e2e68/AbWha2SN5Sn1jyjl/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Phantom developer documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#AB9FF2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.phantom.com/bitcoin/detecting-the-provider\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/bitcoin/detecting-the-provider.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.phantom.com/#organization\",\"name\":\"Phantom developer documentation\",\"url\":\"https://docs.phantom.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/phantom-e50e2e68/tU9g5MXFXgx4l6Em/logo/phantom-light.svg?fit=max\u0026auto=format\u0026n=tU9g5MXFXgx4l6Em\u0026q=85\u0026s=e900bab5ae2cffa45148551c3678ce46\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.phantom.com#website\",\"name\":\"Phantom developer documentation\",\"url\":\"https://docs.phantom.com\",\"publisher\":{\"@id\":\"https://docs.phantom.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.phantom.com/bitcoin/detecting-the-provider#webpage\",\"url\":\"https://docs.phantom.com/bitcoin/detecting-the-provider\",\"name\":\"Detect the provider\",\"description\":\"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\",\"dateModified\":\"2026-06-17T19:10:09.945Z\",\"isPartOf\":{\"@id\":\"https://docs.phantom.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.phantom.com/bitcoin/detecting-the-provider#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.phantom.com/bitcoin/detecting-the-provider#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Traditional Provider\",\"item\":\"https://docs.phantom.com/solana/integrating-phantom\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bitcoin\",\"item\":\"https://docs.phantom.com/bitcoin/integrating-phantom\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Detect the provider\",\"item\":\"https://docs.phantom.com/bitcoin/detecting-the-provider\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.phantom.com/bitcoin/detecting-the-provider#article\",\"headline\":\"Detect the provider\",\"name\":\"Detect the provider\",\"description\":\"To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.\",\"url\":\"https://docs.phantom.com/bitcoin/detecting-the-provider\",\"mainEntityOfPage\":{\"@id\":\"https://docs.phantom.com/bitcoin/detecting-the-provider#webpage\"},\"dateModified\":\"2026-06-17T19:10:09.945Z\",\"publisher\":{\"@id\":\"https://docs.phantom.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.phantom.com#website\"}}]}\u003c/script>","agentPointerHref":"/bitcoin/detecting-the-provider.md","siteName":"Phantom developer documentation","nav":{"global":{"anchors":[{"anchor":"Announcements","icon":"telegram","href":"https://t.me/+R0vUw_QWSO9lNjlh"},{"anchor":"Support","icon":"life-ring","href":"https://docs.google.com/forms/d/e/1FAIpQLSeHWETFkEJbHQCF-lnl1AHmVQPuyfC0HbnxjDjIp6VYV1sBZQ/viewform"},{"anchor":"GitHub","icon":"github","href":"https://github.com/phantom"}]},"tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":"/introduction"}]},{"tab":"Phantom MCP server","pages":[{"title":"Phantom MCP server","href":"/phantom-mcp-server"}]},{"tab":"Phantom CLI","pages":[{"title":"Phantom CLI","href":"/phantom-cli"}]},{"tab":"Phantom Connect SDKs","pages":[{"title":"Phantom Connect SDKs","href":"/wallet-sdks-overview"}]},{"tab":"Recipes","pages":[{"title":"Recipes","href":"/recipes"}]},{"tab":"Developer tools and resources","groups":[{"group":"Overview","pages":[{"title":"Developer tools and resources","href":"/developer-powertools/overview"}]},{"group":"Developer tools","icon":"wrench","pages":[{"title":"AI-assisted development","href":"/developer-powertools/ai-tools"},{"title":"Phantom Cursor plugin","href":"/resources/cursor-plugin"},{"title":"Cursor AI prompts","href":"/resources/cursor-prompts"},{"title":"Phantom Connect SDK MCP server","href":"/resources/mcp-server"}]},{"group":"Security and validation","icon":"shield","pages":[{"title":"Domain and transaction warnings","href":"/developer-powertools/domain-and-transaction-warnings"},{"title":"Transaction Validation","href":"/developer-powertools/lighthouse"},{"title":"Token pages","href":"/developer-powertools/token-pages"},{"title":"Sign-In-With (SIW) standards","href":"/developer-powertools/signing-a-message"},{"title":"Shortcuts","href":"/developer-powertools/shortcuts"}]},{"group":"Solana features","icon":"bolt","pages":[{"title":"Solana priority fees","href":"/developer-powertools/solana-priority-fees"},{"title":"Solana Versioned Transactions","href":"/developer-powertools/solana-versioned-transactions"},{"title":"Wallet Standard","href":"/developer-powertools/wallet-standard"},{"title":"Solana Token Extensions (Token22)","href":"/developer-powertools/solana-token-extensions-token22"}]},{"group":"Testing and debugging","icon":"bug","pages":[{"title":"Testnet mode","href":"/developer-powertools/testnet-mode"},{"title":"Mobile web debugging","href":"/developer-powertools/mobile-web-debugging"}]},{"group":"Best practices","icon":"star","pages":[{"title":"Go-live checklist","href":"/best-practices/launching-a-dapp"},{"title":"Display apps within dialogs","href":"/best-practices/displaying-your-app"},{"group":"Token display and verification","pages":[{"title":"Display tokens on Solana","href":"/best-practices/tokens/token-display"},{"title":"Fungibles","href":"/best-practices/tokens/home-tab-fungibles"},{"title":"NFTs and semi-fungibles","href":"/best-practices/tokens/collectibles-nfts-and-semi-fungibles"},{"title":"Supported media types","href":"/best-practices/tokens/supported-media-types"},{"title":"Make your token appear as verified","href":"/best-practices/tokens/token-verification"}]}]},{"group":"Resources","icon":"book-open","pages":[{"title":"FAQ","href":"/resources/faq"},{"title":"Demo apps","href":"/resources/sandbox"},{"title":"Logos and assets","href":"/resources/assets"}]},{"group":"Traditional Provider","icon":"puzzle-piece","pages":[{"group":"Solana","pages":[{"title":"Get started with Solana","href":"/solana/integrating-phantom"},{"title":"Detect the provider","href":"/solana/detecting-the-provider"},{"title":"Establish a connection","href":"/solana/establishing-a-connection"},{"title":"Sign a message","href":"/solana/signing-a-message"},{"title":"Send a legacy transaction","href":"/solana/sending-a-transaction"},{"title":"Send a versioned transaction","href":"/solana/sending-a-transaction-1"},{"title":"Error messages and codes","href":"/solana/errors"}]},{"group":"EVM networks","pages":[{"title":"Get started with EVM networks","href":"/ethereum-monad-testnet-base-and-polygon/getting-started"},{"title":"Detect the provider","href":"/ethereum-monad-testnet-base-and-polygon/detecting-the-provider"},{"title":"Establish a connection","href":"/ethereum-monad-testnet-base-and-polygon/establishing-a-connection"},{"title":"Sign a message","href":"/ethereum-monad-testnet-base-and-polygon/signing-a-message"},{"title":"Send a transaction","href":"/ethereum-monad-testnet-base-and-polygon/sending-a-transaction"},{"group":"Provider API Reference","pages":[{"title":"Provider API reference","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/README"},{"group":"Methods","pages":[{"title":"Methods","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/methods/README"},{"title":"request","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/methods/request"},{"title":"isConnected","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/methods/isconnected"}]},{"group":"Events","pages":[{"title":"Events","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/events/README"},{"title":"Connect","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/events/connect"},{"title":"Disconnect","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/events/disconnect"},{"title":"Accounts changed","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/events/accounts-changed"},{"title":"Chain changed","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/events/chain-changed"}]},{"group":"Properties","pages":[{"title":"Properties","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/properties/README"},{"title":"isPhantom","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/properties/isphantom"},{"title":"chainId","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/properties/chainid"},{"title":"selectedAddress","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/properties/selectedaddress"},{"title":"networkVersion","href":"/ethereum-monad-testnet-base-and-polygon/provider-api-reference/properties/networkversion"}]}]}]},{"group":"Bitcoin","tag":"Deprecated","pages":[{"title":"Get started with Bitcoin","description":"Integrate Phantom into your Bitcoin web app using the injected provider or Wallet Standard.","href":"/bitcoin/integrating-phantom"},{"title":"Detect the provider","href":"/bitcoin/detecting-the-provider"},{"title":"Establish a connection","description":"Connect your Bitcoin or Ordinals app to Phantom by requesting user permission to share their Bitcoin addresses.","href":"/bitcoin/establishing-a-connection"},{"title":"Sign a message","href":"/bitcoin/signing-a-message"},{"title":"Send a transaction","href":"/bitcoin/sending-a-transaction"},{"title":"Provider API reference","href":"/bitcoin/provider-api-reference"}]},{"group":"Sui","tag":"Deprecated","pages":[{"title":"Get started with Sui","href":"/sui/getting-started-with-sui"},{"title":"Detect the provider","href":"/sui/detecting-the-provider"},{"title":"Establish a connection","href":"/sui/establishing-a-connection"},{"title":"Sign a message","href":"/sui/signing-a-message"},{"title":"Send a transaction","href":"/sui/sending-a-transaction"}]}]},{"group":"Mobile Deep Links","icon":"mobile","pages":[{"title":"Phantom deep links","href":"/phantom-deeplinks/deeplinks-ios-and-android"},{"title":"Handle sessions","href":"/phantom-deeplinks/handling-sessions"},{"title":"Specifying redirects","href":"/phantom-deeplinks/specifying-redirects"},{"title":"Encryption","href":"/phantom-deeplinks/encryption"},{"title":"Limitations","href":"/phantom-deeplinks/limitations"},{"group":"Provider Methods","pages":[{"title":"Provider methods","href":"/phantom-deeplinks/provider-methods/README"},{"title":"Connect","href":"/phantom-deeplinks/provider-methods/connect"},{"title":"Disconnect","href":"/phantom-deeplinks/provider-methods/disconnect"},{"title":"SignAndSendTransaction (deprecated)","href":"/phantom-deeplinks/provider-methods/signandsendtransaction"},{"title":"SignTransaction","href":"/phantom-deeplinks/provider-methods/signtransaction"},{"title":"SignAllTransactions","href":"/phantom-deeplinks/provider-methods/signalltransactions"},{"title":"SignMessage","href":"/phantom-deeplinks/provider-methods/signmessage"}]},{"group":"Other Methods","pages":[{"title":"Other methods","href":"/phantom-deeplinks/other-methods/README"},{"title":"Browse","href":"/phantom-deeplinks/other-methods/browse"},{"title":"Fungible","href":"/phantom-deeplinks/other-methods/fungible"},{"title":"Swap","href":"/phantom-deeplinks/other-methods/swap"}]}]}]}]},"basePath":"","title":"Detect the provider - Phantom developer documentation","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-BbK2OBGL.js","lightbox-handle-r17bVUz3.js"]}