# Launching app via deeplink & logging users in

Deep links allow external links to open your application directly and pass information to it. Instead of opening a website in a browser, a deep link launches your desktop app and provides parameters that your application can read and act on.

This makes it possible to trigger specific actions from outside your app, such as opening a page, loading a resource, or passing data into your application when it starts.

***

#### How To:

In this guide, you'll learn how to configure and handle deep links in your application. \
\
We'll also walk through an example of authenticating users using a **magic link**, where a secure login link is included inside the deep link URL so the user can be automatically signed in when the app opens.

#### Step 1.

Firstly, we need to create a magic login link. We can do this by creating a backend WF that creates a magic link, and saves it to the current user.<br>

<figure><img src="/files/kKbqfL19JRyfdrRGXCxo" alt=""><figcaption></figcaption></figure>

#### Step 2.

Once our magic login link is created and saved to the user, we can then create a WF that navigates to our deeplink, with our magic link as a parameter.\
\
The deeplink is structured as follows:\
\ <kbd>YourAppName://anyDataGoesHere</kbd>

<figure><img src="/files/Ri2TTOYaQrtBFp3Aoyr9" alt=""><figcaption></figcaption></figure>

In our case our app name is `deskifier` and we're adding a `redirect_url` parameter that has our magic link.

#### Step 3.

Next, we need to handle our deeplink data. We can check the [Deeplink URL Used](/deskifier/deskifier-bubble.io-docs/app-element/states.md#deeplink-url-used) state, and navigate to the redirect\_url inside our desktop app.

<figure><img src="/files/p4EXgpSrO9QD10ZEqs88" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
It's important to note a few things about the deeplink - If a deeplink is used by a user when your app isn't open, it will launch your app. In this case, the custom state will be populated when the app loads.\
\
It's also possible that a user uses a deeplink while your app is already running. In this case, the custom state will be updated, and the [App - Deeplink Used](/deskifier/deskifier-bubble.io-docs/app-element/events.md#app-deeplink-used) event will fire.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deskifier.gitbook.io/deskifier/deskifier-bubble.io-docs/guides-and-examples/launching-app-via-deeplink-and-logging-users-in.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
