11---
2- last_modified : 2026-06-25
2+ last_modified : 2026-06-30
33title : " Configuration"
4- description : " Configure deno desktop in deno.json: app metadata, icons, backend selection, output paths, error reporting, and the auto-update server."
4+ description : " Configure deno desktop in deno.json: app metadata, icons, deep-link URL schemes, backend selection, output paths, error reporting, and the auto-update server."
55---
66
77:::info Available in Deno 2.9
@@ -21,6 +21,7 @@ still compiles, using sensible defaults.
2121{
2222 " name" : " my-app" ,
2323 " version" : " 1.4.0" ,
24+ " exports" : " ./main.ts" ,
2425 " desktop" : {
2526 " app" : {
2627 " name" : " My App" ,
@@ -29,7 +30,8 @@ still compiles, using sensible defaults.
2930 " macos" : " ./icons/app.icns" ,
3031 " windows" : " ./icons/app.ico" ,
3132 " linux" : " ./icons/app.png"
32- }
33+ },
34+ " deepLinks" : [" myapp" ]
3335 },
3436 " backend" : " cef" ,
3537 " output" : {
@@ -101,6 +103,52 @@ are assembled into the right container per platform.
101103
102104If no ` icons ` entry is set for a platform, the default Deno icon is used.
103105
106+ ### ` app.deepLinks `
107+
108+ Custom URL schemes (deep links) the app registers with the OS, so that opening a
109+ ` <scheme>://... ` link routes to your app. Each entry is a bare scheme name with
110+ no ` :// ` .
111+
112+ ``` jsonc
113+ " deepLinks" : [" myapp" ]
114+ ```
115+
116+ With the above, the OS treats ` myapp://open/document/42 ` as belonging to your
117+ app. List several schemes if your app handles more than one:
118+
119+ ``` jsonc
120+ " deepLinks" : [" myapp" , " myapp-beta" ]
121+ ```
122+
123+ Scheme names follow the
124+ [ RFC 3986] ( https://datatracker.ietf.org/doc/html/rfc3986#section-3.1 ) grammar:
125+ they must start with an ASCII letter and may otherwise contain letters, digits,
126+ ` + ` , ` - ` , and ` . ` . Names are lowercased during registration. The reserved
127+ schemes ` http ` , ` https ` , ` file ` , ` ftp ` , ` ws ` , and ` wss ` are rejected, since
128+ registering them as app handlers would hijack normal browsing. An invalid or
129+ reserved scheme fails the build.
130+
131+ Registration happens at bundle time, per platform:
132+
133+ - ** macOS** adds a ` CFBundleURLTypes ` entry (with your schemes under
134+ ` CFBundleURLSchemes ` ) to the bundle ` Info.plist ` . This is written before
135+ code-signing so the signature stays valid.
136+ - ** Linux** adds an ` x-scheme-handler/<scheme> ` MIME type to the ` .desktop `
137+ entry and ensures ` Exec= ` forwards the opened URL via the ` %u ` field code.
138+ - ** Windows** has no in-bundle registration for protocol handlers, so the
139+ bundler drops a ` register-deep-links.bat ` next to the launcher. It writes the
140+ ` HKCU\Software\Classes\<scheme> ` keys pointing back at the launcher. An
141+ installer (or the user) runs it once after install.
142+
143+ :::info Registration only
144+
145+ This registers the schemes with the OS so links are routed to your app. Handling
146+ the opened URL inside a running app (delivering the URL to your code) is coming
147+ in a later release; declare your schemes now so packaging and OS registration
148+ are in place.
149+
150+ :::
151+
104152## ` backend `
105153
106154Which web rendering engine to embed. One of ` "cef" ` , ` "webview" ` , or ` "raw" ` .
@@ -221,5 +269,6 @@ Configuration is validated at the start of `deno desktop`:
221269- Icon paths must resolve to existing files.
222270- Output paths must be writable.
223271- ` release.baseUrl ` must parse as a URL.
272+ - ` app.deepLinks ` entries must be valid, non-reserved URL schemes.
224273
225274Errors are reported with the offending ` deno.json ` location.
0 commit comments