Deep links
Open your dApp inside Morsel's browser from a link, add an Open in Morsel button, and link to screens in the Morsel app.
A deep link opens a website inside the Morsel app's browser on iPhone and Android, where it can connect to the user's wallet. Use them for Open in Morsel buttons and shared links.
Link formats
In both formats, the site is the full URL, encoded with encodeURIComponent, placed after browse/.
| Format | Example |
|---|---|
| Universal link | https://www.morselwallet.app/ul/browse/https%3A%2F%2Fexample.com%2Fmint |
| App link | morsel://browse/https%3A%2F%2Fexample.com%2Fmint |
- iPhone: the universal link opens Morsel when it's installed. Without Morsel, it opens a page on morselwallet.app with Open in Morsel, Get Morsel, and Continue on [site] in this browser.
- Android: verified App Links aren't live yet, so the
https://link opens the phone's browser first, and its page then hands off to Morsel with themorsel://link. If you know the user is on Android, link tomorsel://browse/…directly. - Desktop: the universal link opens the same page, where Continue on [site] in this browser takes the user to your site to connect with the Chrome extension.
Use https://www.morselwallet.app with www.
Rules
- Encode the whole URL, including
https://. Its path and query string are kept. - Only
http://andhttps://sites open.javascript:,data:,file:and other schemes are ignored. - Morsel still checks the site against its phishing blocklist.
Add an Open in Morsel button
Show the button to phone visitors who don't have Morsel's provider on the page. Inside Morsel's browser, window.morsel exists, so you can hide it there.
const openInMorsel = (url = window.location.href) =>
`https://www.morselwallet.app/ul/browse/${encodeURIComponent(url)}`;
const isPhone = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
const hasMorsel = typeof window !== 'undefined' && 'morsel' in window;
if (isPhone && !hasMorsel) {
const button = document.querySelector('#open-in-morsel');
button.href = openInMorsel();
button.hidden = false;
}<a id="open-in-morsel" hidden>Open in Morsel</a>With the connect kit, you don't need this: connecting on a phone without Morsel sends the user there for you.
Links to Morsel screens
These open screens in the Morsel app, when it's installed:
| Link | Opens |
|---|---|
morsel://wallet | Home |
morsel://swap | Swap |
morsel://staking | Staking |
If a link is for a network the user isn't on, Morsel switches network first.