<!-- Environment variables: STATICPEAR_URL, HTTPS_PROXY and two endpoints | Docs -->

Docs

# Environment variables.

For your static IPs.

Keep your proxy URL in one environment variable, STATICPEAR_URL, and pass it to the HTTP client that makes the calls your partner allowlists.

Docs

- [Overview](https://staticpear.com/docs/)
- [How the proxy works](https://staticpear.com/docs/how-it-works/)
- [Your IPs](https://staticpear.com/docs/ips/)
- [Limits](https://staticpear.com/docs/limits/)
- [Environment variables](https://staticpear.com/docs/environment-variables/)
- [Security](https://staticpear.com/docs/security/)
- [Troubleshooting](https://staticpear.com/docs/troubleshooting/)
- [Platform guides](https://staticpear.com/docs/#guides)

## STATICPEAR_URL.

Your proxy URL starts with https:// (your app talks TLS to the proxy) and uses port 3129. It carries your username and password, so keep it in your platform’s secrets, never in the browser or in your code.

Pass the proxy URL to your client · Example

```
// npm install undiciimport { fetch, ProxyAgent } from "undici"; // Endpoint A first, then B if A can't be reached (connection errors only)const endpoints = [process.env.STATICPEAR_URL, process.env.STATICPEAR_URL_B].filter(Boolean);const agents = endpoints.map((url) => new ProxyAgent(url)); export async function partnerFetch(url, init) {  let lastError;  for (const dispatcher of agents) {    try {      return await fetch(url, { ...init, dispatcher });    } catch (err) {      lastError = err; // e.g. ECONNREFUSED, ETIMEDOUT: try the other endpoint    }  }  throw lastError;}
```

```
import osimport requests res = requests.get(    "https://api.partner.example/v1/orders",    proxies={"https": os.environ["STATICPEAR_URL"]},    timeout=20,)
```

```
// Go: a client whose transport uses your proxy URLproxyURL, _ := url.Parse(os.Getenv("STATICPEAR_URL"))client := &http.Client{    Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},    Timeout:   20 * time.Second,}res, err := client.Get("https://api.partner.example/v1/orders")
```

```
# One request through your proxy URLcurl --proxy "$STATICPEAR_URL" https://api.partner.example/v1/orders
```

## HTTPS_PROXY.

Many tools (curl, Python requests, Go’s default client) also read HTTPS_PROXY. Setting it sends every HTTPS call from that process through your proxy, and calls to hosts you haven’t approved are refused. Use it only where every HTTPS call goes to approved hosts, or list the others in NO_PROXY. Node.js’s built-in fetch doesn’t use a proxy unless you pass one, so pass it explicitly as above.

HTTPS_PROXY

HTTPS_PROXY for one process · Example

```
# Only for a process whose every HTTPS call goes to approved hosts:export HTTPS_PROXY="$STATICPEAR_URL"# Hosts that must not use the proxy (they would be refused by the allowlist):export NO_PROXY="localhost,.internal.example"
```

## Two endpoints: A and B.

Your pair has two endpoints, one on each IP. Keep A in STATICPEAR_URL and B in STATICPEAR_URL_B. Send through A; if a connection to A fails, retry the request through B. Your client does this itself (the Node.js example above shows how). Allowlist both IPs with your partner.

---

Page: https://staticpear.com/docs/environment-variables/
