The video uses a specific AI coding tool to demonstrate the setup, but the configuration works 1:1 with Cursor, Claude Code, or any other tool. Despia is web framework and tooling agnostic, so the only thing that matters is the redirect.
window.open(url, '_blank') and routes the URL to one of two destinations: the in-app browser by default, or the system browser (Safari on iOS, Chrome on Android) for whitelisted domains. The system browser route exists primarily for App Store and Play Store compliance around payments and OAuth.
Installation
- Bundle
- CDN
How it works
The runtime interceptswindow.open(url, '_blank') and decides where the URL opens based on its domain. Domains in your Despia whitelist open in the system browser. Everything else opens in the in-app browser, which keeps the user inside your app and lets them return with a tap.
window.open call, so any link, button, or framework router that produces a _blank target works without modification.
Configure domain routing in Despia
Whitelist domains in the Despia Editor under App > Integrations > External Links. Add the bare domain (nohttps://, no path), one per line. Any URL whose host matches a whitelisted entry opens in the system browser. Subdomain matching is exact, so add each subdomain you need separately.
Common whitelist entries by use case:
- Payments:
buy.stripe.com,checkout.stripe.com,paypal.com,www.paypal.com - OAuth:
accounts.google.com,appleid.apple.com,github.com,login.microsoftonline.com - App Store rules: anything that takes a credit card or grants account access typically belongs here
Open external content in the in-app browser
The default route is the right choice for help articles, blog posts, terms of service, and any read-only content where you want the user to come back. The in-app browser sits over your app, dims the background, and dismisses with a single tap.<a target="_blank">, since some frameworks intercept anchor clicks for client-side routing.
Open payments and OAuth in the system browser
Once a domain is whitelisted, the samewindow.open call routes to Safari or Chrome instead. No special syntax, no SDK call, just window.open(url, '_blank') with a URL whose host is on the list.
Resources
NPM Package
despia-native