QuotaGuard and Vercel Integration Guide
QuotaGuard Static IPs give your Vercel Serverless Functions two fixed outbound IP addresses for firewalled databases and IP-restricted APIs. Set QUOTAGUARDSTATIC_URL as a Vercel environment variable, attach the proxy to your function’s outbound calls, and every request exits from one of your two static IPs.
Why Vercel Functions Need a Static IP
Vercel Serverless Functions run on ephemeral infrastructure where the outbound IP is drawn from large, rotating public cloud ranges. A database or API that only accepts requests from a known source IP will reject your function, and the address changes across deployments and invocations so you cannot simply allowlist what you see today.
Getting Started
After creating a QuotaGuard account, you are redirected to your dashboard, where you can find your proxy credentials and two static IP addresses.
Choose the right proxy region: Select the QuotaGuard region closest to your function region to minimize latency. The region is set at sign-up. Changes after sign-up require contacting support.
Step 1: Add Your Proxy URL as a Vercel Environment Variable
In the dashboard, open Settings > Environment Variables, or use the CLI:
vercel env add QUOTAGUARDSTATIC_URL
Add the value http://username:password@<your-quotaguard-proxy-host>:9293 and select the environments it applies to (Production, Preview, Development). A variable added to only Production will not be present in Preview deployments, which is a common cause of “works in prod, fails in preview.”
Step 2: Attach the Proxy in a Node.js Serverless Function
Vercel’s Node.js functions can use a proxy agent. Attach it to the outbound call.
// api/data.js
import { ProxyAgent } from 'undici';
const dispatcher = new ProxyAgent(process.env.QUOTAGUARDSTATIC_URL);
export default async function handler(req, res) {
const response = await fetch('https://api.example.com/data', { dispatcher });
const data = await response.json();
res.status(200).json(data);
}
If you use node-fetch rather than the built-in fetch, attach an HttpsProxyAgent instead:
import fetch from 'node-fetch';
import { HttpsProxyAgent } from 'https-proxy-agent';
const agent = new HttpsProxyAgent(process.env.QUOTAGUARDSTATIC_URL);
export default async function handler(req, res) {
const response = await fetch('https://api.example.com/data', { agent });
res.status(200).json(await response.json());
}
For a database driver, pass the proxy through the driver’s options or use a SOCKS5 connection on port 1080. Connection-pooling drivers that hold a socket open work best when the function is configured to reuse the connection across invocations.
Python functions
If you deploy Python functions on Vercel, the pattern is the same.
import os, requests
def handler(request):
p = os.environ["QUOTAGUARDSTATIC_URL"]
r = requests.get("https://api.example.com/data", proxies={"http": p, "https": p})
return r.json()
Edge Functions Do Not Support Arbitrary Proxies
Vercel Edge Functions run on a restricted runtime that does not allow arbitrary proxy agents or raw socket control. You cannot route an Edge Function through QuotaGuard directly. Move the calls that need a static IP into a Node.js Serverless Function and call that function from the edge if needed. This is the single most common Vercel integration mistake, so confirm the function that makes the external call is a Node.js Serverless Function, not an Edge Function.
Testing Your Function Is Using the Static IP
You cannot shell into a serverless function, so test through an endpoint. Add a temporary function:
// api/verify-ip.js
import { ProxyAgent } from 'undici';
const dispatcher = new ProxyAgent(process.env.QUOTAGUARDSTATIC_URL);
export default async function handler(req, res) {
const r = await fetch('https://ip.quotaguard.com', { dispatcher });
res.status(200).json(await r.json());
}
Deploy and hit the endpoint:
curl https://your-app.vercel.app/api/verify-ip
Expected response:
{"ip":"<one of your two QuotaGuard static IPs>"}
The returned IP must match one of the two static IPs in your QuotaGuard dashboard. Call it more than once to see both (load-balanced).
A Note on Vercel’s Native Static IPs
Vercel offers a native Static IPs feature, and Secure Compute on Enterprise provides dedicated IPs. If you run a single project and IP allowlisting is your only need, the native feature solves it. QuotaGuard tends to win when you run several projects, because Vercel prices its static IPs per project while one QuotaGuard subscription covers every project and every platform, when you need the same two IPs across other hosts like Railway or Render so a partner allowlists one pair, or when you want to avoid tying your fixed identity to a single platform. Choose whichever fits. This page documents the QuotaGuard path.
Troubleshooting
407 Proxy Authentication Required
The credentials are wrong. Confirm the QUOTAGUARDSTATIC_URL value matches your QuotaGuard dashboard exactly, including the username and password.
Works in production, fails in preview
The environment variable was added to Production only. Add it to Preview and Development too, then redeploy.
Wrong IP returned
The proxy is not attached to the request. Confirm you passed the dispatcher or agent on the specific fetch call and that the call runs in a Node.js function, not an Edge Function.
Edge runtime error about unsupported API
You are trying to attach a proxy in an Edge Function. Move the external call to a Node.js Serverless Function.
Build-time vs runtime
Read QUOTAGUARDSTATIC_URL inside the handler, not at module top level evaluated during build, so the value is present at request time.
QuotaGuard Static vs QuotaGuard Shield
| Feature | QuotaGuard Static | QuotaGuard Shield |
|---|---|---|
| Protocol | HTTP / HTTPS / SOCKS5 | HTTPS / SOCKS5 over TLS |
| Customer-to-proxy hop | Plaintext | TLS-encrypted |
| HTTPS payload | Tunneled end-to-end, never decrypted at the proxy | Tunneled end-to-end, never decrypted at the proxy |
| Best for | Most apps | Regulated data or environments that require TLS on every hop |
| Starting price | $19/month | $29/month |
For most Vercel apps, Static is the right product. Choose QuotaGuard Shield if your functions handle regulated data or your environment requires TLS between your app and the proxy itself.
Ready to Get Started?
Get in touch or create a free trial account.
View Vercel Integration Features
Read: Vercel Static Outbound IP Without Paying Per Project