Environment Info

Environment information is automatically captured and included in error reports.

Browser Environment

In browser environments, ErrorMail captures:

{
  "runtime": "browser",
  "url": "https://example.com/page",
  "referrer": "https://google.com",
  "userAgent": "Mozilla/5.0...",
  "browser": "Chrome",
  "browserVersion": "120",
  "os": "macOS",
  "platform": "MacIntel",
  "language": "en-US",
  "screenSize": "1920x1080",
  "viewportSize": "1200x800",
  "devicePixelRatio": 2,
  "colorDepth": 24,
  "timezone": "America/New_York",
  "onLine": true,
  "cookiesEnabled": true
}

Node.js Environment

In Node.js environments, ErrorMail captures:

{
  "runtime": "node",
  "nodeVersion": "v20.10.0",
  "platform": "darwin",
  "arch": "arm64",
  "memoryUsage": {
    "heapUsed": 12345678,
    "heapTotal": 20000000,
    "external": 1000000,
    "rss": 50000000
  }
}

Manual Access

import { getEnvironmentInfo } from 'errormail';

const env = getEnvironmentInfo();
console.log(env);

Disabling Environment Info

import { configureErrorReporting } from 'errormail';

configureErrorReporting({
  apiKey: 'your-api-key',
  includeEnvironment: false // Disable environment capture
});