Lightpanda (lightpanda v0.2.10-rc.2)

Copy Markdown View Source

Lightpanda is an installer and runner for the Lightpanda headless browser.

By default this package fetches binaries from the u2i fork build of Lightpanda, which carries an extra patch sending session cookies on the WebSocket upgrade request — required for cookie-authenticated WS endpoints (e.g. Phoenix LiveView). To use upstream binaries instead, override :url (see below).

Configuration

Configure in your config/config.exs:

config :lightpanda,
  version: "fork-2026-05-10",
  default: [
    args: ~w(serve --host 127.0.0.1 --port 9222)
  ]

Global options

  • :version - the expected lightpanda binary version. Defaults to the fork release tag this package tracks.

  • :path - the path to the lightpanda binary. By default it is automatically downloaded and placed inside the _build directory.

  • :release - which release to track. Either a version string (default, derived from :version) or "nightly" to track the nightly build (only available against upstream's URL template).

  • :url - the base URL template to download the binary from. Defaults to Lightpanda.default_base_url/0 (u2i fork releases). To use upstream binaries:

    config :lightpanda,
      url: "https://github.com/lightpanda-io/browser/releases/download/$version/lightpanda-$target"

    Supports the placeholders $version and $target.

  • :verify_checksum - set to false to skip SHA-256 verification of the downloaded binary. Useful when pointing :url at a build whose checksums aren't baked into this package. Defaults to true.

  • :version_check - set to false to skip the boot-time check that warns when the installed binary's version doesn't match the configured :version. Defaults to true.

Profiles

Each profile accepts:

  • :args - arguments to pass to the lightpanda binary.
  • :cd - the working directory.
  • :env - environment variables as a map of string key/value pairs.

Summary

Functions

Returns the path to the Lightpanda binary.

Returns the version of the installed Lightpanda binary, or nil if not found.

Returns the configured version of the Lightpanda binary.

Returns the default URL template used to fetch the binary.

Ensures the Lightpanda binary is installed.

Installs the Lightpanda binary.

Installs the binary if missing, then runs it with the given profile and extra arguments.

Returns the latest known version of the Lightpanda binary.

Runs the Lightpanda binary with the given profile and extra arguments.

Returns the platform target string (e.g., "aarch64-macos").

Functions

bin_path()

Returns the path to the Lightpanda binary.

bin_version()

Returns the version of the installed Lightpanda binary, or nil if not found.

configured_version()

Returns the configured version of the Lightpanda binary.

default_base_url()

Returns the default URL template used to fetch the binary.

Defaults to the u2i fork releases (https://github.com/u2i/lightpanda-browser), which include the cookie-on-WebSocket-upgrade patch needed by cookie- authenticated WS endpoints (e.g. Phoenix LiveView).

Supports $version and $target placeholders. Override via config :lightpanda, :url, "..." to point at upstream's releases or a local mirror.

ensure_installed!()

Ensures the Lightpanda binary is installed.

Concurrent callers are deduplicated via Lightpanda.Installer so that parallel install_and_run/2 invocations (or Lightpanda.Server startups) only download once.

install()

Installs the Lightpanda binary.

install_and_run(profile, extra_args)

Installs the binary if missing, then runs it with the given profile and extra arguments.

Returns the exit status.

latest_version()

Returns the latest known version of the Lightpanda binary.

run(profile, extra_args \\ [])

Runs the Lightpanda binary with the given profile and extra arguments.

target()

Returns the platform target string (e.g., "aarch64-macos").