How to Add an In-App Browser to Your Expo App

DavidDavid October 25, 2026 7 min read

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

  1. Install: npx expo install expo-web-browser. Using expo install picks the version that matches your SDK.
  2. Import: import * as WebBrowser from 'expo-web-browser'. It is a namespace import, so every call reads as WebBrowser.openBrowserAsync and so on.
  3. Start testing in Expo Go. The reference lists the module as included in Expo Go, on Android, iOS and web.
  4. 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 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

OptionWhat it doesPlatform
toolbarColorColor of the toolbarAll (React Native color formats)
controlsColorTint color for the controlsiOS
dismissButtonStyleLabel of the close button: 'done', 'close' or 'cancel'iOS
presentationStyleHow the sheet is presented (default OVER_FULL_SCREEN)iOS
readerModeOpens in Safari Reader mode if it is availableiOS
enableBarCollapsingHides the toolbar as the user scrollsAll
showTitleShows the page title in the toolbarAndroid
secondaryToolbarColorColor of the secondary toolbarAndroid
enableDefaultShareMenuItemAdds a default share item to the menuAndroid

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 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

NeedUseWhy
Show your privacy policy, terms or a help pageexpo-web-browser openBrowserAsyncUser stays in your app and gets real Safari or Chrome behavior
Sign in with a web-based provideropenAuthSessionAsync (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 onLinking.openURL from expo-linkingOpens the full system browser app
Web content that is part of your own screen layoutreact-native-webviewYou 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.

Free app-building tips, straight to your inbox

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

David

Written by

David

Founder and app builder

Keep reading

ExpoClaude Code

How to Add Notification Actions to Your Expo App

To add notification actions to an Expo app, register a category with Notifications.setNotificationCategoryAsync, give it action buttons (and optionally a text reply), set categoryIdentifier on the notification, then read response.actionIdentifier in a response listener. Here is every action option, how to handle taps when the app was closed, the Android and iOS differences, and a Claude Code prompt that wires it all up.

David 8 min
Read article
ExpoClaude Code

How to Schedule Local Notifications in Your Expo App

To schedule local notifications in an Expo app, install expo-notifications, set a notification handler, ask for permission, create an Android channel, then call scheduleNotificationAsync with your content and a trigger like DAILY, WEEKLY or DATE. Here is every trigger type, how to cancel and list what is scheduled, why Android reminders arrive late, and a Claude Code prompt that builds the whole reminder flow.

David 8 min
Read article

Ready to build it yourself?

Join App Store Launch Club, the #1 community for building and launching apps, for $9/month.

← Back to the blog