Back to services

Self-hosted proxy

Install zapads-proxy

The one-line installer downloads the latest zapads-proxy release (manifest on this site, binaries on Vercel Blob), verifies SHA256, and writes ~/.zapads-proxy/config.yaml. If you prefer not to pipe a script from the web, follow the manual steps below. The same host serves the installer script at GET /install (text/x-shellscript) — opening that URL in a browser may download the file instead of showing HTML.

  1. 1

    Prerequisites

    • • macOS or Linux on amd64 or arm64
    • python3 and curl available on your PATH
    • • A ZapAds provider API key, your service's slug (the service_id from the dashboard), your backend base URL, and either a Blink API key or LNbits URL + admin key (set lnbits as the second arg to the installer, or ZAPADS_INSTALL_LIGHTNING_BACKEND=lnbits)
    • • Your project's log-invocation URL (Supabase Edge Function), unless your host bakes ZAPADS_LOG_INVOCATION_URL into the install script
  2. 2

    Download a release binary

    Fetch the current release manifest from /api/v1/releases/proxy/latest. It returns JSON with a per-{os,arch} entry containing a signed .tar.gz URL and its sha256. Download the tarball, verify the digest, extract zapads-proxy, and install it to ~/.local/bin (or another directory on your PATH). The curl … | bash installer above does exactly this.

  3. 3

    Configuration

    Create ~/.zapads-proxy/config.yaml. Use apps/proxy/testdata/config.yaml in this repo as a reference: set zapads.api_key, zapads.log_invocation_url, zapads.l402_root_secret (at least 32 characters), lightning (Blink), and a services entry whose name matches your dashboard service_id and whose backend is your API origin.

  4. 4

    Run and verify

    shell
    zapads-proxy --config ~/.zapads-proxy/config.yaml
    curl -fsS http://127.0.0.1:8081/.zapads/health

Automated installer (optional)

From a service in the dashboard you can copy a curl command that downloads the script from this site. Replace YOUR_SERVICE_ID with your slug. The second argument (optional) is blink (default) or lnbits for self-hosted or FakeWallet testing:

curl -fsSL https://zap-ads-web.vercel.app/install | bash -s -- YOUR_SERVICE_ID
curl -fsSL https://zap-ads-web.vercel.app/install | bash -s -- YOUR_SERVICE_ID lnbits
ZAPADS_INSTALL_LIGHTNING_BACKEND=lnbits curl -fsSL https://zap-ads-web.vercel.app/install | bash -s -- YOUR_SERVICE_ID