How to add an in-app browser to your Expo app, in short
Use expo-web-browser. Install it with npx expo install expo-web-browser, import it with import * as WebBrowser from 'expo-web-browser', and call await WebBrowser.openBrowserAsync('https://example.com/privacy'). On iPhone the page slides up in a Safari sheet inside your app; on Android it opens in a Chrome Custom Tab. The user reads, taps Done or back, and they are still in your app.
That one call covers most of the links an app actually has: the privacy policy, the terms, a help article, a blog post, a pricing page on your site. The work that makes it feel finished is the part around the call: styling it to match your app, knowing what the returned result means on each platform, and not using it for the jobs it is wrong for. That is what this guide covers.
Step 1: Install expo-web-browser
- Install: npx expo install expo-web-browser. Using expo install picks the version that matches your SDK.
- Import: import * as WebBrowser from 'expo-web-browser'. It is a namespace import, so every call reads as WebBrowser.openBrowserAsync and so on.
- Start testing in Expo Go. The reference lists the module as included in Expo Go, on Android, iOS and web.
- There are no permissions to request. Opening a web page in the system browser component does not touch the camera, photos or location, so there is no usage message to write.
The module also ships a config plugin for properties that cannot be set at runtime and need a new native build. You do not need it to open a link, so leave app.json alone until you have a specific reason.
Step 2: Open your first link
The smallest working example is a button: <Button title="Privacy policy" onPress={() => WebBrowser.openBrowserAsync('https://yourapp.com/privacy')} />. openBrowserAsync takes the URL as its first argument and an optional options object as its second, and returns a promise. What that promise tells you depends on the platform, which catches people out:
What openBrowserAsync resolves with
| Platform | What happens | Result |
|---|---|---|
| iOS | Safari opens in a modal using SFSafariViewController | { type: 'cancel' } when the user closes it, { type: 'dismiss' } if you closed it with dismissBrowser() |
| Android | Chrome opens in a Custom Tab | { type: 'opened' } once the browser was opened |
| Web | Supported, per the reference | Our advice: do not build logic on a specific result here |
So on iOS the promise waits until the sheet is closed, and on Android it resolves as soon as the tab opens. If you want to refresh something when the user comes back (say they just read the updated terms), do not hang that on the promise alone. On Android it will run while the page is still on screen. Listening for the app becoming active again with React Native's AppState works on both.
Step 3: Style the browser to match your app
The second argument to openBrowserAsync is a WebBrowserOpenOptions object. These are the ones most apps reach for:
Useful WebBrowserOpenOptions
| Option | What it does | Platform |
|---|---|---|
| toolbarColor | Color of the toolbar | All (React Native color formats) |
| controlsColor | Tint color for the controls | iOS |
| dismissButtonStyle | Label of the close button: 'done', 'close' or 'cancel' | iOS |
| presentationStyle | How the sheet is presented (default OVER_FULL_SCREEN) | iOS |
| readerMode | Opens in Safari Reader mode if it is available | iOS |
| enableBarCollapsing | Hides the toolbar as the user scrolls | All |
| showTitle | Shows the page title in the toolbar | Android |
| secondaryToolbarColor | Color of the secondary toolbar | Android |
| enableDefaultShareMenuItem | Adds a default share item to the menu | Android |
Our take: set toolbarColor and controlsColor from your theme and stop there. A browser that opens in your brand color feels like part of the app; one that flashes default white feels like the user just got kicked out. If your app has a dark theme, pick the colors from the active scheme rather than hard-coding one, the same way you would for the rest of your [dark mode setup](/blog/how-to-add-dark-mode-to-your-expo-app).
For long articles or help docs, readerMode: true on iOS is a cheap win. For pages you control, like your own privacy policy, leave it off so the page looks the way you designed it.
Step 4: Close it from code and handle links back into the app
WebBrowser.dismissBrowser() closes the presented browser, but the reference lists it for iOS only. It resolves with { type: 'dismiss' } on success and throws if dismiss is not available, so wrap it in a try/catch or guard it with Platform.OS.
Where this matters is when a web page sends the user back into your app through a deep link, for example after a checkout or an email confirmation page. If your project uses Expo Router, the reference says those deep links are handled automatically. Without Expo Router, add a handler with Linking.addEventListener before you open the browser, and call dismissBrowser() when it fires, because the browser is not dismissed automatically when the deep link is handled. The [Expo deep linking guide](/blog/expo-deep-linking-guide) covers setting up the scheme that makes those links work.
Step 5: Use openAuthSessionAsync for login, not openBrowserAsync
This is the most important distinction in the module. On iOS, the modal Safari that openBrowserAsync opens does not share cookies with the system Safari. That is fine for reading a page. It is wrong for signing in, because the session the user creates there is not the one your auth flow expects. The reference is direct about it: use openAuthSessionAsync for authentication and openBrowserAsync when you just want to open a webpage such as your privacy policy.
- openAuthSessionAsync(url, redirectUrl, options) opens a login page and waits for the redirect back into your app. On iOS it uses ASWebAuthenticationSession, which asks the user whether to allow the app to authenticate with that site. On Android it uses a Custom Tab together with AppState and Linking.
- The redirect URI registered with your auth provider has to use your app's scheme from expo.scheme in app.json. If the scheme does not match, the browser never hands control back.
- The result is { type: 'success', url } when the redirect comes back, and { type: 'cancel' } if the user declines or closes the browser. Parse the url for the code or token.
- On iOS, preferEphemeralSession: true asks for a private session that does not share cookies with the user's normal browser. The reference notes that whether this is honored depends on the user's default browser. It is useful when you do not want an old logged-in session to sign the user straight into the wrong account.
- On web, the auth flow opens a popup, and WebBrowser.maybeCompleteAuthSession() must run on the page the popup redirects to so it can close the popup. Web auth also needs a secure origin, so run npx expo start --https when you test it locally.
In practice most apps do not call openAuthSessionAsync by hand; an auth library or provider SDK calls it for you. Knowing that it is underneath is what lets you debug a login that opens and never comes back. The full picture is in our guides on [authentication in Expo](/blog/how-to-add-authentication-to-your-expo-app) and [Google Sign-In](/blog/how-to-add-google-sign-in-to-your-expo-app).
In-app browser vs system browser vs WebView
Expo's own linking guide draws the line simply: expo-linking opens a URL in the operating system's default browser app, and expo-web-browser opens it in an in-app browser. A third option, react-native-webview, renders web content as a view inside your own screen. Pick by the job:
Which one to use
| Need | Use | Why |
|---|---|---|
| Show your privacy policy, terms or a help page | expo-web-browser openBrowserAsync | User stays in your app and gets real Safari or Chrome behavior |
| Sign in with a web-based provider | openAuthSessionAsync (usually via your auth library) | Built to wait for the redirect back into your app |
| Hand the user off to a site they will spend time on | Linking.openURL from expo-linking | Opens the full system browser app |
| Web content that is part of your own screen layout | react-native-webview | You control the view, but you own navigation and security |
Mistakes that make an in-app browser feel broken
- Using openBrowserAsync for login on iOS and wondering why the session never sticks.
- Running 'user came back' logic off the openBrowserAsync promise, which resolves immediately on Android.
- Calling dismissBrowser() on Android without a guard, where it is not available.
- Forgetting to register the redirect URI with your app's scheme, so an auth session opens and never returns.
- Leaving the default white toolbar in a dark-themed app.
- Embedding a WebView with open navigation for links that only needed an in-app browser.
Have Claude Code set it up for you
Open your project in the Claude Code desktop app and be specific. Left vague, AI-written code tends to sprinkle openBrowserAsync calls with different hard-coded colors across every screen, or reach for a WebView where it does not belong. A prompt that keeps it in one place:
Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "All external links go through src/lib/openLink.ts; never call openBrowserAsync or Linking.openURL directly" so a later session does not bypass it. Test on a real iPhone and a real Android phone, since the browser that opens and the result you get back differ between them.
The short version
To add an in-app browser to your Expo app: install expo-web-browser, call WebBrowser.openBrowserAsync(url) for pages you want users to read without leaving, style it with toolbarColor and controlsColor, remember the promise behaves differently on iOS and Android, and only use dismissBrowser() on iOS. Use openAuthSessionAsync for anything that signs a user in, and Linking.openURL when you actually want them in the full browser.
If you are building your first iOS app with Claude Code and Expo and want a second pair of eyes on it before App Review, bring it to App Store Launch Club. Members share their builds for feedback, and the [curriculum](/curriculum) covers the full path from first build to first users. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
How do I open a link in an in-app browser in Expo?
Install expo-web-browser with npx expo install expo-web-browser, import * as WebBrowser from 'expo-web-browser', and call await WebBrowser.openBrowserAsync('https://...'). It opens SFSafariViewController on iOS and a Chrome Custom Tab on Android.
Does expo-web-browser work in Expo Go?
Yes. The reference lists it as included in Expo Go, and it works on Android, iOS and web.
What is the difference between openBrowserAsync and Linking.openURL?
openBrowserAsync from expo-web-browser opens the page in an in-app browser, so the user stays in your app. Linking.openURL from expo-linking opens the page in the operating system's default browser app, which takes the user out of your app.
Should I use openBrowserAsync for login?
No. On iOS the modal Safari opened by openBrowserAsync does not share cookies with the system Safari. Use openAuthSessionAsync for authentication, which waits for the redirect back into your app. Most auth libraries call it for you.
How do I close the in-app browser from code?
Call WebBrowser.dismissBrowser(). The reference lists it for iOS only and it throws if dismiss is not available, so guard it with Platform.OS or a try/catch.
Why does openBrowserAsync resolve right away on Android?
On Android the promise resolves with { type: 'opened' } as soon as the browser opens. On iOS it waits and resolves with { type: 'cancel' } when the user closes it. If you need to know when the user returns, listen for the app becoming active with AppState.
Can I change the color of the Expo in-app browser?
Yes. Pass toolbarColor in the options to openBrowserAsync, plus controlsColor on iOS and secondaryToolbarColor on Android. Both accept React Native color formats.
Last reviewed by David on October 25, 2026

