> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/common/screen/open-url.md).

# Open external URL

`openURL` This function is a utility that lets you open a specified URL in the device's default browser or a linked app. This function internally uses React Native's [`Linking.openURL`](https://reactnative.dev/docs/0.72/linking#openurl)internally.

**Signature**

```typescript
function openURL(url: string): Promise<any>;
```

**Parameters**

* **url** · Required · `string`

  The external web address or deep link path you want to open.

**Return value**

* `Promise<any>`

  Returns a Promise that resolves when the URL is successfully opened.

**Example**

**Open an external website**

{% tabs %}
{% tab title="tsx\[React]" %}

```tsx[react]
import { openURL } from '@apps-in-toss/web-framework';

function Page() {
  const handlePress = () => {
    openURL('https://google.com');
  };

  return (
    <button onClick={handlePress}>
      Open Google website
    </button>
  );
}
```

{% endtab %}

{% tab title="React Native" %}

```tsx
import { openURL } from '@granite-js/react-native';
import { Button } from 'react-native';

function Page() {
  const handlePress = () => {
    openURL('https://google.com');
  };

  return <Button title="Open Google website" onPress={handlePress} />;
}
```

{% endtab %}
{% endtabs %}

**Open a deep link**

{% tabs %}
{% tab title="tsx\[React]" %}

```tsx[react]
import { openURL } from '@apps-in-toss/web-framework';

openURL('intoss://{appName}');
```

{% endtab %}

{% tab title="React Native" %}

```tsx
import { openURL } from '@granite-js/react-native';

openURL('intoss://{appName}');
```

{% endtab %}
{% endtabs %}

### Notes

* If an external URL cannot be opened (e.g., invalid scheme, network blocked), the Promise may be rejected.
* In a WebView environment, a browser tab opens in a new window, and in the default app, it switches to an external app or browser.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/common/screen/open-url.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
