Deep link for vanilla javascript Capacitor project?


I have a working Capacitor project based on a vanilla javascript website and I need to add deep links. However according to the documentation here:

There’s only examples for Vue and React. Is there any way to add deep links in Capacitor for vanilla Javascript?


We don’t have any examples (but I’m adding them right now in the v4 docs!), but you can use the App plugin and create a listener where-ever your application entry point is

App.addListener('appUrlOpen', (event: URLOpenListenerEvent) => {
  const hasDeeplink = event.url.includes('MY_COOL_DEEPLINK');

  if (hasDeeplink) {
    // Do Deeplink here
  } else {
    // Appliation enters normally