Skip to content

Commit b0ae917

Browse files
committed
Add deferred deep link documentation
1 parent cc99a44 commit b0ae917

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/deep-links.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ addRoute(home);
102102
- Handler function must be synchronous.
103103
- Handler function must not change anything. Deep links are read-only, and all actions/changes must be confirmed by the user in the UI layer.
104104
- For a deeper understanding of the route definitions and their properties, [check router implementation and its types](https://github.com/MetaMask/metamask-extension/blob/main/shared/lib/deep-links/routes/route.ts#L18).
105+
- For a link to work as a deferred deep link, it needs to be added to the branch.io _LinkHub_. For more information check [deferred deep links section below](#deferred-deep-links).
105106

106107
## Architecture
107108

@@ -201,6 +202,22 @@ classDiagram
201202

202203
Deep Link Router is instantiated in the background script ([background.js](https://github.com/MetaMask/metamask-extension/blob/main/app/scripts/background.js#L757)).
203204

205+
### Deferred deep links
206+
207+
Deferred deep links are used to navigate a user to a deep link route after the extension is installed.
208+
For deferred deep link to work, it is required to add the specific link with its path to the branch.io _LinkHub_.
209+
210+
The extension receives deferred deep link data from the MetaMask website, which collects that data via the integrated Branch.io SDK.
211+
212+
Deferred deep link flow:
213+
1. When a user lands on the MetaMask website download page, the website stores the deferred deep link inside cookie.
214+
2. When the user installs MetaMask extension, the extension reads and stores the cookie from the MetaMask website.
215+
3. Then extension navigates the user to the deferred deep link after successful onboarding.
216+
217+
Notes:
218+
- Deferred deep link is stored in the extension's local storage immediately after installation.
219+
- User is navigated to the deferred deep link only if they completed the onboarding process within the two hours after installation.
220+
204221
## Security
205222

206223
It is recommended that deep links provided by MetaMask are signed.

0 commit comments

Comments
 (0)