Open links

Open URLs, deep links, and native screens from your app.

Open a page as a modal

Present another page over the current one without losing its state. Pass transition: "modal"; modal_style is sheet or fullscreen (default sheet), and modal_detent is large or medium (default large, sheets only). Close dismisses the whole modal; Back pops pages inside it.

await bdk.navigation.navigate({
  url: "https://example.com/checkout",
  transition: "modal",
  modal_style: "sheet",
  modal_detent: "medium"
});

Older app builds open it as a normal page. Where the platform offers only fullscreen (Android today), a sheet request presents fullscreen.

Know when a modal closes

The page that opened the modal receives navigation.dismissed once after it closes. Subscribe before you call. The payload is a NavigationDismissedEvent.

bdk.on("navigation.dismissed", (event) => {
  console.log(event.reason, event.url);
});

await bdk.navigation.navigate({
  url: "https://example.com/checkout",
  transition: "modal",
  modal_style: "sheet",
  modal_detent: "medium"
});

Fall back to web navigation

These calls resolve to a NativeCommandResult (see Handling results for its fields). Outside the app triggered is false — use that to fall back to ordinary web navigation.

const result = await bdk.navigation.openLink({
  link: "https://example.com/pricing",
  view: "website"
});

if (!result.triggered) {
  window.open("https://example.com/pricing", "_blank");
}