Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyxpo-web-browser

An in-app browser and OAuth sign-in sessions for pyxpo apps. The API follows expo-web-browser. iOS uses SFSafariViewController and ASWebAuthenticationSession; Android uses Custom Tabs (androidx.browser).

pip install pyxpo-web-browser
[tool.pyxpo]
scheme = "myapp"
modules = ["web-browser"]
import pyxpo_web_browser as WebBrowser

result = await WebBrowser.open_browser_async("https://pyxpo.dev", toolbar_color="#202020")

result = await WebBrowser.open_auth_session_async(
    "https://auth.example.com/authorize?client_id=abc&redirect_uri=myapp%3A%2F%2Fcallback", "myapp://callback")
if result["type"] == "success":
    query = parse_qs(urlparse(result["url"]).query)

Functions

Function Notes
open_browser_async(url, **options) Opens an http or https URL. iOS resolves when the browser closes: {"type": "cancel"} (the user closed it) or {"type": "dismiss"} (dismiss_browser()). Android resolves at once with {"type": "opened"}. {"type": "locked"} when a browser is already open (iOS).
dismiss_browser() Closes the browser. On Android it brings the app back to the front.
open_auth_session_async(url, redirect_url, **options) Opens a sign-in page and waits for a redirect to redirect_url. Returns {"type": "success", "url"}, {"type": "cancel"}, {"type": "dismiss"} or {"type": "locked"}.
dismiss_auth_session() Closes the sign-in page; its call returns {"type": "dismiss"}.
warm_up_async(browser_package=None) Android: starts the browser's Custom Tabs service early. Returns {"servicePackage"}.
may_init_with_url_async(url, browser_package=None) Android: lets the browser preload url.
cool_down_async(browser_package=None) Android: releases the service.
get_custom_tabs_supporting_browsers_async() Android: browserPackages, servicePackages, defaultBrowserPackage, preferredBrowserPackage.
maybe_complete_auth_session() Web only in Expo; returns {"type": "failed"} here.

camelCase names work too (openBrowserAsync, toolbarColor=...).

Options

Option Platform Notes
toolbar_color both Any pyxpo color ("#202020", "orange").
secondary_toolbar_color Android
controls_color iOS Tint of the buttons.
enable_bar_collapsing both Hide the bar while scrolling.
show_title Android Show the page title.
enable_default_share_menu_item Android
show_in_recents Android Keep the tab in the recent apps list (default off).
create_task Android Open the tab in its own task (default on).
browser_package Android Use this browser instead of the preferred one.
dismiss_button_style iOS "done", "close" or "cancel".
reader_mode iOS Enter Reader when available.
presentation_style iOS A WebBrowserPresentationStyle; default overFullScreen.
prefer_ephemeral_session iOS, sign-in Share no cookies with Safari. This also skips the "wants to use ... to sign in" prompt.

Sign-in on Android

Custom Tabs have no sign-in session. The package opens the page and waits for the redirect to come back as a deep link, so redirect_url must use the app's scheme. The tab opens in the app's task, and the redirect closes it. When the user returns to the app without the redirect, the call returns {"type": "dismiss"}.

Android 15 and later

While a tab is on top, the app is in the background. Android 15+ blocks activity starts from background apps and freezes their processes a few seconds later. So dismiss_browser() and dismiss_auth_session() called while a tab is showing may not close it: the calls still return, and the app resumes when the user leaves the tab. Sign-in redirects are not affected, because the system delivers the deep link.

Platforms

iOS and Android. On desktop, open_browser_async opens the system browser and open_auth_session_async raises NotSupportedError.

Metadata

Release files for pyxpo-web-browser 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxpo-web-browser 0.1.0a1
File Size Uploaded
pyxpo_web_browser-0.1.0a1.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyxpo-web-browser 0.1.0a1
File Interpreter ABI Platform
pyxpo_web_browser-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / pyxpo_web_browser-0.1.0a1.tar.gz

Download URL pyxpo_web_browser-0.1.0a1.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bcd3ee100bfa4d80ef7a12144969198304729ba6571b8d158bd9db3608a63b0f
BLAKE2b-256 checksum
How to use checksums
5450416a3a9842d0e0dcba9329f89d93d45dabe22d8b7c3c3e73604f047b4cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / pyxpo_web_browser-0.1.0a1-py3-none-any.whl

Download URL pyxpo_web_browser-0.1.0a1-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bf7aa7becef9a79ebee43394363b2874704fe7d46e4f2ea7249b7b8e17f27aa
BLAKE2b-256 checksum
How to use checksums
a743a4877e65af2f4cc1d50192523c33ef9d0e9a812142cd1f1643454d9e7db6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page