Skip to content

Browser extensions

Unlike a static site, a browser extension can safely store a client credential, so it can send payments and read payment history, not only receive. Today the only way to do so is through a hosted sidecar. However, the following two paths are planned for better browser support:

Hosted sidecar

The sidecar accepts credentials per request, so the extension can keep the user's credential and send it along with each request, without configuring any credentials on the sidecar itself:

  1. Run the sidecar with no default credentials. It then serves only requests that carry an Authorization: Bearer <client credentials> header.
  2. Put a reverse proxy such as nginx or Caddy in front of it with TLS, since the sidecar listens on localhost over plain HTTP.
  3. In the extension, store the user's client credential and send it in the Authorization header of every request.

Alternatively, the user can run the sidecar on their own machine and point the extension at http://localhost:5393, with no server of yours involved.

Note that the sidecar sees every credential it relays, so whoever hosts it can control those wallets while it runs. The sidecar does not save per-request credentials to disk unless webhooks are enabled, in which case it stores them in its data directory so that payment tracking can resume after a restart, and deletes them once the tracked payments have finalized. On a hosted sidecar, leave LEXE_WEBHOOK_URL unset and poll for payment status instead.