{"id":17317,"library":"opbeat-http-client","title":"Opbeat HTTP Client","description":"The `opbeat-http-client` is a low-level HTTP client designed specifically for interacting with the Opbeat intake API, intended for developers building higher-level Opbeat integration modules rather than direct application usage. Its last published version is 1.2.2, which was released before Opbeat's acquisition by Elastic in June 2017. Following the acquisition, the standalone Opbeat service was transitioned into Elastic APM, and related Opbeat agents (like `opbeat-node`) were deprecated in favor of Elastic APM agents. Consequently, this client is no longer maintained and its target API is obsolete. It primarily differentiates itself by being a minimal, focused client for a specific (now defunct) APM service, in contrast to general-purpose HTTP clients like Axios or Node's built-in `http` module.","status":"abandoned","version":"1.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/watson/opbeat-http-client","tags":["javascript","opbeat","http","client"],"install":[{"cmd":"npm install opbeat-http-client","lang":"bash","label":"npm"},{"cmd":"yarn add opbeat-http-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add opbeat-http-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS `require` syntax exclusively. It exports a factory function, not a direct client instance.","wrong":"import opbeatHttpClientFactory from 'opbeat-http-client';","symbol":"opbeatHttpClientFactory","correct":"const opbeatHttpClientFactory = require('opbeat-http-client');"},{"note":"The factory function returns a client instance with a `request` method. This method is the primary API for sending data to Opbeat endpoints like 'errors' or 'releases'.","symbol":"client.request","correct":"opbeatHttpClient.request('errors', body, callback);"}],"quickstart":{"code":"const opbeatHttpClientFactory = require('opbeat-http-client');\n\n// NOTE: The Opbeat service is deprecated. This code will likely fail\n// as the intake API endpoints are no longer active.\n// Replace with your actual (historical) Opbeat credentials if attempting to run.\nconst client = opbeatHttpClientFactory({\n  appId: process.env.OPBEAT_APP_ID ?? 'your-app-id',\n  organizationId: process.env.OPBEAT_ORG_ID ?? 'your-organization-id',\n  secretToken: process.env.OPBEAT_SECRET_TOKEN ?? 'your-secret-token',\n  userAgent: 'my-custom-module/1.0.0'\n});\n\nconst errorBody = {\n  message: 'Simulated error from opbeat-http-client',\n  culprit: 'example.js',\n  timestamp: new Date().toISOString()\n};\n\nclient.request('errors', errorBody, function (err, res, body) {\n  if (err) {\n    console.error('Failed to send error to Opbeat:', err.message);\n    // Expected error: 'getaddrinfo ENOTFOUND intake.opbeat.com'\n  } else if (res && res.statusCode !== 202) {\n    console.error(`Opbeat responded with status ${res.statusCode}: ${body}`);\n  } else {\n    console.log('Successfully sent error to Opbeat:', body);\n  }\n});\n\nconsole.log('Attempting to send data to deprecated Opbeat API...');","lang":"javascript","description":"Demonstrates initializing the Opbeat HTTP client with required credentials and making a request to the 'errors' endpoint. This example highlights that the underlying Opbeat service is deprecated."},"warnings":[{"fix":"Migrate to Elastic APM and use the official Elastic APM Node.js agent (or other language-specific agents) for application performance monitoring. This package is obsolete.","message":"The Opbeat service and its associated APIs were deprecated following its acquisition by Elastic in June 2017. This client communicates with the intake.opbeat.com API, which is no longer active. Any attempts to use this client will result in network errors or failed requests, as the service has been replaced by Elastic APM.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Do not use this package in new projects. For existing projects, prioritize migration to a current APM solution like Elastic APM or OpenTelemetry.","message":"This package is explicitly considered abandoned and unmaintained. Its last update was prior to 2018. Using it introduces risks associated with unpatched vulnerabilities, lack of compatibility with modern Node.js versions, and reliance on a defunct service.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure the options object passed to the factory function contains all four required properties, even if they are placeholders due to the service's deprecation.","message":"The client requires all initialization options (`appId`, `organizationId`, `secretToken`, `userAgent`) to be present. Omitting any of these will lead to runtime errors during client instantiation.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"This error confirms the Opbeat service is offline. The package is obsolete; migration to Elastic APM or another APM solution is required.","cause":"The Opbeat intake API endpoint (intake.opbeat.com) is no longer active or resolvable.","error":"Error: getaddrinfo ENOTFOUND intake.opbeat.com"},{"fix":"Ensure you are using `const opbeatHttpClient = require('opbeat-http-client')({ ... })` for CJS environments, passing the configuration object directly to the `require`'d factory function.","cause":"Attempting to directly call `opbeat-http-client` as a function without `require` or using it like an ES module `import`.","error":"TypeError: opbeatHttpClient is not a function"}],"ecosystem":"npm","meta_description":null}