Skip to content

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.

  • iPhone
  • Android

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.

In both formats, the site is the full URL, encoded with encodeURIComponent, placed after browse/.

FormatExample
Universal linkhttps://www.morselwallet.app/ul/browse/https%3A%2F%2Fexample.com%2Fmint
App linkmorsel://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 the morsel:// link. If you know the user is on Android, link to morsel://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:// and https:// 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.

open-in-morsel.js
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;
}
button.html
<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.

These open screens in the Morsel app, when it's installed:

LinkOpens
morsel://walletHome
morsel://swapSwap
morsel://stakingStaking

If a link is for a network the user isn't on, Morsel switches network first.

Try one of these