Many users open DogeOS dApps inside the MyDoge app, in its in-app browser, rather than in Safari or Chrome. To your page it looks like an ordinary mobile browser, but MyDoge has a wallet built in, and it decides which pages may use it. Most of what’s different about building for MyDoge follows from that.
The Wallet Belongs to an Origin#
MyDoge opens a dApp from its listing and gives the wallet to the origins on that listing. An origin is a URL’s scheme, hostname and port, so https://example.com, https://www.example.com and https://app.example.com are three different origins. A page on any other origin, even in the same browser view, doesn’t get the wallet.
This protects users. A dApp’s pages can link anywhere, and the sites they link to shouldn’t inherit the user’s wallet just because they opened in the same view. So the wallet follows the listing, not the browser tab. MyDoge 3.1.0 grants it only to the exact origin the dApp opened at; from 3.1.1 (build 652), a listing can name more than one origin.
The same rule explains why a plain link to another dApp can’t connect: that dApp loads inside your dApp’s session, on an origin your listing doesn’t cover. A mydoge://dapp link instead asks MyDoge to open the other dApp from its own listing, with its own wallet session. MyDoge doesn’t try to guess which links lead to other dApps, because many dApps navigate to other sites on purpose, for sign-in, checkout or redirects, and moving those into a new session would break them.
MyDoge Injects the Wallet#
MyDoge injects an EIP-1193 provider as the page starts loading, and announces it through EIP-6963 with rdns set to com.mydoge.wallet. Once the page has loaded, it also grants the page a per-page permission, and only on the listing’s origins. The SDK waits for both before it connects, which is why a slow first page load delays the connection, and why a page on the wrong origin never connects.
MyDoge injects into the top-level page only. Iframes can show charts and other content, but wallet requests must come from the top-level page.
The SDK Steps Aside#
In an ordinary browser, the SDK shows its own wallet list and loads the embedded wallet for email and social sign-in. Inside MyDoge neither makes sense: the user already has a wallet open, and showing a second wallet would be confusing. So inside MyDoge the SDK sends every wallet request to the MyDoge app and shows none of its own wallet UI. openModal() asks MyDoge to connect, WalletConnectEmbed shows a small MyDoge card, and DogeOS email and social sign-in, which need a popup, aren’t available.
This is why your app needs no separate build or configuration for MyDoge. The same connect button works in both places, and useWalletHost() tells you which one you’re in when you need to know.
A first visit doesn’t prompt to connect when the page loads; the user taps your connect button. That keeps MyDoge from asking for wallet access the moment someone browses to a dApp they haven’t chosen to use yet.
An Embedded Browser Has Limits#
MyDoge’s browser isn’t a full browser. window.open loads pages in the same view instead of a new window, so popup-based sign-in can’t report back. Google doesn’t allow sign-in in embedded browsers. And MyDoge opens links that leave your dApp, such as links to another dApp or to X, only when the user taps them, so a page can’t send users elsewhere without their action.
Which Wallet Your dApp Gets#
MyDoge users can have social wallets, created by signing in to MyDoge with email, Google, Apple or X, and classic wallets, created from or imported with a recovery phrase. Inside MyDoge, your dApp gets whichever wallet the user has selected, classic or social. In an ordinary browser, DogeOS sign-in gives the social wallet for the method the user chose. One person can therefore show up with several addresses, which matters if your app ties progress to an address. See About Wallet Connections.
Versions#
MyDoge’s in-app browser has changed over its recent releases, and users update at their own pace:
- MyDoge 3.1.0: the wallet works on the origin the dApp opened at. Plain tapped links to X open in the X app.
- MyDoge 3.1.1 (build 652): listings can name several origins,
mydoge://dapplinks open other dApps, and X links also work fromtarget="_blank"andwindow.open()on iOS. - Planned, not yet released: an account sheet, silent reconnect of approved dApps, and account-change events. The SDK already supports them.
The MyDoge reference lists what each build supports.