# Open URL

{% embed url="<https://youtu.be/QxCkMp_n5JA?si=4zsLcUC9QQHYhAcT>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=QxCkMp_n5JA>

The **Open URL** action launches external URLs using the device's default browser or in-app web views. This enables seamless integration with web content, external services, and third-party applications.

***

#### 📦 Properties

| Property     | Type                | Required | Description                                  |
| ------------ | ------------------- | -------- | -------------------------------------------- |
| `url`        | Expression (String) | ✅        | The URL to open (must be valid format)       |
| `launchMode` | String              | ❌        | How to open the URL (see launch modes below) |

***

#### ✅ Common Use Cases

* Opening help documentation or FAQ pages
* Linking to social media profiles or marketing pages
* Accessing external product pages or support portals
* Integrating with payment gateways or authentication services
* Sharing links to articles, videos, or resources

***

#### ⚙️ Default Behavior

By default:

| Behavior                 | Description                                           |
| ------------------------ | ----------------------------------------------------- |
| **Launch Mode**          | Uses platform default (typically external browser)    |
| **URL Validation**       | Validates URL format before attempting to open        |
| **Error Handling**       | Throws errors for invalid URLs or unsupported schemes |
| **Platform Integration** | Leverages device capabilities for URL handling        |

***

#### 🛠️ How to Use

<figure><img src="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-b8ece717b1e75a2262030fb3f9c15d1cc5f63507%2Fopen_url_action.png?alt=media" alt="Copy Slugs"><figcaption><p>Copy Slug</p></figcaption></figure>

1. Add the action to a widget event (e.g., button tap, link click)
2. Choose **Open URL** from the action list
3. Set the `url` property to the target web address
4. Optionally configure `launchMode` for specific opening behavior

***

#### 🌐 Launch Modes

<figure><img src="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-ed9cca8aea1dc311b34ce9d3d592705764878b50%2Fopen_url_launch_mode_action.png?alt=media" alt="Copy Slugs"><figcaption><p>Copy Slug</p></figcaption></figure>

| Mode                               | Description                           | Use Case                   |
| ---------------------------------- | ------------------------------------- | -------------------------- |
| `platformDefault`                  | Uses device's default URL handler     | Standard web links         |
| `inAppWebView` / `inApp`           | Opens in embedded web view within app | Keep users in your app     |
| `externalApplication` / `external` | Opens in external browser/app         | Full browser experience    |
| `externalNonBrowserApplication`    | Opens in external non-browser app     | Deep linking to other apps |

***

{% embed url="<https://digiaacademy.portal.trainn.co/share/open-url-examples>" %}
