window.dogesoft
Quickstart & connect
Detect window.dogesoft, request access, and read your first connected account.
Doge Soft injects a single object, window.dogesoft, into the page —
from the browser extension on desktop, and from the DogeSoft app's in-app browser on mobile. Same
object, same methods on both. It's the only thing you need to feature-detect, connect, and start
reading a user's Dogecoin account. No SDK install, no iframe, no API key.
window.dogesoft.version currently reports
"1.1.0", and window.dogesoft.network
is "mainnet" — there's no separate testnet provider today.
1. Detect the provider
The provider is injected before your page's scripts run (at document start in the extension; on
onPageFinished in the app browser), so a synchronous check at load
time is almost always enough. For scripts that might run before injection completes, listen for the
dogesoft#initialized event as a fallback.
function waitForDogesoft() {
return new Promise((resolve) => {
if (window.dogesoft) return resolve(window.dogesoft);
window.addEventListener("dogesoft#initialized", () => resolve(window.dogesoft), { once: true });
});
}
const dogesoft = await waitForDogesoft();
console.log("ready:", dogesoft.version, dogesoft.network);
2. Connect
connect() prompts the user to approve your origin, then resolves with
their account list. Nothing is shared before the user explicitly approves the prompt.
const { accounts } = await window.dogesoft.connect();
const address = accounts[0];
const isConnected = await window.dogesoft.isConnected();
const balance = await window.dogesoft.getBalance();
console.log(address, balance);
Prefer the generic dispatcher? Every friendly method has a matching request()
call — see PSBTs & the request() interface.
3. Read the active account
| Method | Returns |
|---|---|
getAccounts() | Array of connected addresses |
getAddress() | The active address as a string |
getPublicKey() | The active account's public key |
getBalance() | Confirmed DOGE balance for the active address |
disconnect() | Revokes your origin's access |
Next: react to account changes and prove ownership with signMessage.