Skip to content

onOpenUrl

Module @netwiv/api/plugins/deep-link · Kind Function

import { onOpenUrl } from '@netwiv/api/plugins/deep-link';

Helper function for the deep-link://new-url event to run a function each time the protocol is triggered while the app is running. Use getCurrent on app load to check whether your app was started via a deep link.

function onOpenUrl(handler: (urls: string[]): void) => Promise<UnlistenFn>
import { onOpenUrl } from '@netwiv/api/plugins/deep-link';
await onOpenUrl((urls) => { console.log(urls) });
  • Windows / Linux: Unsupported without the single-instance plugin. The OS will spawn a new app instance passing the URL as a CLI argument.

Upstream since 2.0.0


Descriptions come from the pinned @tauri-apps/plugin-deep-link@2.4.10 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.