Skip to main content

openURL

Opens the given URL. Depending on the scheme, this can open the host app's internal browser, a phone dialer (tel:), a mail client (mailto:), or another installed app via its custom scheme.

Signature

import { openURL } from '@apps-in-toss/web-framework';

declare function openURL(url: string): Promise<void>;

Parameters

NameTypeRequiredDescription
urlstringThe URL to open. Supports https://, tel:, and mailto: schemes. Invalid URLs may be silently ignored.

Returns

  • Promise<void> — resolves once the open request is delivered.
  • In the devtools mock, window.open(url, '_blank') is called instead.

Permission

No permission required.

Examples

Minimal

import { openURL } from '@apps-in-toss/web-framework';

await openURL('https://example.com');

Realistic — a "Call support" button

import { openURL } from '@apps-in-toss/web-framework';

export function SupportButton() {
async function callSupport() {
await openURL('tel:1234-5678');
}

return (
<button type="button" onClick={callSupport}>
Call customer support
</button>
);
}

Try it live

Open the Navigation page in sdk-example and run the openURL card.

Open in sdk-example
  • closeView — close the current mini-app view.
  • share — open the system share sheet with a message.

External references