← back to home

integration docs

Get EdgeViz running on your site in minutes.

overview

EdgeViz uses a Service Worker to detect connectivity failures anywhere in the path — ISP issues, DNS failures, CDN edge problems, or origin outages. Because Service Workers must be served from the same origin as your site, you need to proxy three files through your web server:

Once proxied, add a single script tag to your HTML and you're done.

nginx

# Add to your server block
location ~ ^/(edgeviz-sw|edgeviz-core|edgeviz)\.js$ {
    proxy_pass https://edgeviz.net;
    proxy_ssl_server_name on;
    proxy_set_header Host edgeviz.net;

    # Cache for 1 hour (optional but recommended)
    proxy_cache_valid 200 1h;
}

Then reload nginx:

nginx -t && nginx -s reload

apache

Requires mod_proxy and mod_proxy_http enabled.

# Add to your VirtualHost
ProxyPass "/edgeviz-sw.js" "https://edgeviz.net/edgeviz-sw.js"
ProxyPassReverse "/edgeviz-sw.js" "https://edgeviz.net/edgeviz-sw.js"
ProxyPass "/edgeviz-core.js" "https://edgeviz.net/edgeviz-core.js"
ProxyPassReverse "/edgeviz-core.js" "https://edgeviz.net/edgeviz-core.js"
ProxyPass "/edgeviz.js" "https://edgeviz.net/edgeviz.js"
ProxyPassReverse "/edgeviz.js" "https://edgeviz.net/edgeviz.js"

# Required for service worker scope
<Location "/edgeviz-sw.js">
    Header set Service-Worker-Allowed "/"
</Location>

Then restart Apache:

apachectl graceful

caddy

yourdomain.com {
    # Proxy EdgeViz files
    @edgeviz path /edgeviz-sw.js /edgeviz-core.js /edgeviz.js
    reverse_proxy @edgeviz https://edgeviz.net {
        header_up Host edgeviz.net
    }

    # Your other config...
    root * /var/www/html
    file_server
}

cloudflare workers

If your site is behind Cloudflare, you can use a Worker to proxy the files:

export default {
  async fetch(request) {
    const url = new URL(request.url);

    if (url.pathname === '/edgeviz-sw.js' ||
        url.pathname === '/edgeviz-core.js' ||
        url.pathname === '/edgeviz.js') {
      const edgevizUrl = 'https://edgeviz.net' + url.pathname + url.search;
      return fetch(edgevizUrl);
    }

    // Pass through to origin
    return fetch(request);
  }
}

Deploy with route pattern: yourdomain.com/edgeviz-*

vercel / next.js

Add to your vercel.json or next.config.js:

// vercel.json
{
  "rewrites": [
    { "source": "/edgeviz.js", "destination": "https://edgeviz.net/edgeviz.js" },
    { "source": "/edgeviz-sw.js", "destination": "https://edgeviz.net/edgeviz-sw.js" },
    { "source": "/edgeviz-core.js", "destination": "https://edgeviz.net/edgeviz-core.js" }
  ]
}

embed the script

Once the proxy is configured, add this to your HTML (before </body> or in <head>):

<script async src="https://yourdomain.com/edgeviz.js?id=YOUR_CLIENT_ID"></script>
Always use async

The async attribute is critical. Without it, if the EdgeViz origin is unreachable, the script tag will block your page load until the proxy times out.

Finding your Client ID

Log into your dashboard and hover over your name in the top right. Your Client ID will be shown in the tooltip.

verify installation

1 Open your site in a browser

2 Open DevTools → Application → Service Workers

3 You should see edgeviz-sw.js registered

4 Check the Console for any errors

Troubleshooting

If the service worker fails to register, check that:

  • Your site is served over HTTPS
  • The proxy is returning the JS files (not 404)
  • No CSP headers are blocking the script

add your domain

For beacons to be accepted, your domain must be registered with your account. This happens automatically when you first send a beacon, or you can add domains manually in the dashboard.

how detection works

EdgeViz monitors the full path between your users and your origin. The service worker intercepts navigation requests and detects failures at any layer:

When a failure is detected, the service worker sends a beacon to EdgeViz. Beacons carry diagnostics about the failure — what broke, where the user is, what network they're on, and what the edge saw.

beacon types

The service worker sends different beacon types depending on the situation:

Multi-path delivery

Beacons are sent over multiple paths simultaneously — IPv4, IPv6, DNS, and relay workers — to maximize the chance of reaching EdgeViz even when parts of the internet are broken. The dashboard shows which paths each beacon arrived on.

incidents & recovery

When failure beacons arrive, EdgeViz groups them into incidents by domain and failure type. An incident tracks:

When all affected sessions send recovery beacons, the incident is marked as recovered and a recovery alert is triggered. Incidents without new beacons expire after 12 hours.

Recovery enrichment

DNS-only incidents start with sparse data — no geo, no browser, no edge PoP — because DNS beacons are minimal signals. When a recovery beacon arrives over HTTP, EdgeViz automatically backfills the missing details (location, ISP, browser, device) from the richer recovery data.

alerts

EdgeViz can send alerts when incidents are detected or recover. Configure alert destinations in your dashboard settings — webhook URLs, email, or Slack. Each alert includes the incident type, affected domain, impact percentage, and a link to the dashboard.