{"id":22615570,"url":"https://github.com/marcellodesales/node-newrelic-api","last_synced_at":"2025-03-29T00:42:34.125Z","repository":{"id":24084352,"uuid":"27471283","full_name":"marcellodesales/node-newrelic-api","owner":"marcellodesales","description":"New Relic Bindings for the JSON and XML Web Services APIs for Node","archived":false,"fork":false,"pushed_at":"2016-05-10T21:19:30.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-25T19:58:45.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcellodesales.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-03T05:37:12.000Z","updated_at":"2016-05-07T16:41:22.000Z","dependencies_parsed_at":"2022-08-22T09:50:09.653Z","dependency_job_id":null,"html_url":"https://github.com/marcellodesales/node-newrelic-api","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fnode-newrelic-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fnode-newrelic-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fnode-newrelic-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcellodesales%2Fnode-newrelic-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcellodesales","download_url":"https://codeload.github.com/marcellodesales/node-newrelic-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122247,"owners_count":20726822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T19:08:22.783Z","updated_at":"2025-03-29T00:42:34.107Z","avatar_url":"https://github.com/marcellodesales.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-newrelic-api\n=========================\n[![Travis](https://travis-ci.org/marcellodesales/node-newrelic-api.svg)](https://travis-ci.org/marcellodesales/node-newrelic-api)\n[![Dependency Status](https://david-dm.org/marcellodesales/node-newrelic-api.svg)](https://david-dm.org/marcellodesales/node-newrelic-api)\n\nAsync and Sync Node.js bindings for the New Relic XML and RESTFul APIs into a single one.\n\n[![NPM](https://nodei.co/npm/node-newrelic-api.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/node-newrelic-api/)\n\nDescription\n========\n\nNew Relic provides some of their APIs through XML or RESTful JSON endpoints, but they use different hosts, methods. This is a consolidated API that intends to provide bindings to their Public APIs in Node.js using Async and Sync methods.\n\n* Async: Useful when implementing anything in the event loop for your app.\n* Sync: Useful for bootstrap APIs that needs to be executed sequentially.\n\nThe APIs added per version are as follows:\n\n| Version | Feature\n|-------  | ---------\n| 0.1.1   | * Deployments: Caches the application deployment \n| -----   | --------\n| 0.1.0   | * *Accounts*: Retrieve account information; (XML v1 API)\n|         | * *Application*: Retrieve application information; (JSON V2 API)\n|         | * *Deployments*: Submits application deployment information. (XML V1 API)\n\nBy default, APIs are async, and the optional sync method will include the suffix \"Sync\".\n\nInstallation\n=========\n\n```\nnpm install --save node-newrelic-api\n```\n\nAccounts API\n===========\n\nThe XML V1 API binds that retrieves information about an account.\n\n* https://docs.newrelic.com/docs/apm/apis/new-relic-rest-api-v1/getting-started-new-relic-rest-api-v1#account_id\n\nAccounts.get(opts, callback)\n-----------\n\nRetrieves the account information based on the license information.\n\n```js\n  opts: {\n    appKey: {string} // The license key provided by New Relic.\n  }\n\n  /**\n   * @param {object} err Is the possible error related to connectivity with New Relic.\n   * @param {object} AccountInfo Is the object information translated from XML V1 API to JSON.\n   */\n  function callback(err, account) { }\n```\n\nAccounts.getSync(opts) := AccountInfo\n-----------\n\nThe blocking version of the accounts info.\n\n```js\n\n  opts: {\n    appKey {string} // The license key provided by New Relic.\n  }\n\n```\n\nSample\n-----------\n\n```js\nAccountInfo = \n{ name: 'Node.js App',\n  subscription: \n   { state: 'paid',\n     annualRenewalOn: '2015-09-30',\n     startsOn: '2014-01-17',\n     productName: 'Enterprise Annual'\n  },\n  apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',\n  dataAccessKey: 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy',\n  licenseKey: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',\n  eventFeedUri: '/account_feeds/cccccccccccccccccccccccccccccccccc/events.rss',\n  primaryAdmin: \n   { email: 'admin@example.com',\n     state: 'active',\n     firstName: 'Marcello',\n     lastName: 'de Sales' \n   } \n}\n```\n\nApplication API\n===========\n\nThe JSON V2 API binds that retrieves information about an application. (Lists on next versions)\n\n* https://docs.newrelic.com/docs/apm/apis/api-explorer-v2/getting-started-new-relics-api-explorer\n\nApplications.get(opts, callback)\n-----------\n\nRetrieves the application information based on the license information and the name of an app.\n\n```js\n  opts: {\n    appKey: {string}, // The license key provided by New Relic.\n    appName: {string} // The name of the application that you have deployed.\n  }\n\n  /**\n   * @param {object} err Is the possible error related to connectivity with New Relic.\n   * @param {object} AccountInfo Is the object information translated from XML V1 API to JSON.\n   */\n  function callback(err, app) { }\n```\n\nApplications.getSync(opts) := ApplicationInfo\n-----------\n\nThe blocking version of the application info.\n\n```js\n  opts: {\n    appKey {string}, // The license key provided by New Relic.\n    appName: {string} // The name of the application that you have deployed.\n  }\n```\n\nSample\n------\n\nSample for the application info:\n\n```js\nApplicationInfo =\n{ id: xyxyxyxyxyx,\n  name: 'nodejs-sample',\n  language: 'nodejs',\n  health_status: 'gray',\n  reporting: false \n}\n```\n\nDeployments\n============\n\nProvides an API to support the submission of deployments, retrieving the deployment info.\n\nMore info at https://rpm.newrelic.com/accounts/xxxxxxx/applications/yyyyyyyy/deployments/instructions\n\nDeployments.get(opts, callback)\n-----------\n\nRetrieves the deployment information based on the license information and the name of an app.\n\n```js\n  opts: {\n    appKey: {string}, // The license key provided by New Relic.\n    appName: {string} // The name of the application that you have deployed.\n    git: {object} // The git object with current version  //\n  }\n\n  /**\n   * @param {object} err Is the possible error related to connectivity with New Relic.\n   * @param {object} deployment Is the object containing the information from XML V1 API to JSON.\n   */\n  function callback(err, deployment) { }\n```\n\nDeployments.getSync(opts) := DeploymentInfo\n-----------\n\nThe blocking version of the deployments API.\n\n```js\n  opts: {\n    appKey {string}, // The license key provided by New Relic.\n    appName: {string} // The name of the application that you have deployed.\n    git: \n  }\n```\n\nSample\n------\n\nSample for the application info:\n\n```js\n{ id: 'xyxyxyxyx',\n  appName: 'nodejs-sample',\n  accountId: '0000000',\n  agentId: 'zdzdzd',\n  changelog: '[First working version] .',\n  description: 'Submitted from mdesales@ubuntu (192.168.248.137).',\n  revision: '670383',\n  timestamp: '2014-12-02T00:53:02-08:00',\n  user: 'user' \n} \n```\n\nInstallation\n=========\n\n```\nnpm install --save node-newrelic-api\n```\n\nUse\n=========\n\nThe test directory contains examples on how to call the API using the Async and Sync modes. You will need to use:\n\n* `LICENSE_KEY`: Your license Key provided by your account.\n* `App Name`: Usually the name of the app based on the package.json.\n\nSome examples of the output of the current version include:\n\nContributing\n==============\n\nWe use the GitFlow branching model http://nvie.com/posts/a-successful-git-branching-model/.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b feature/issue-444-Add-Rest-APIs origin/master --track`)\n * Adding the Jira ticket ID helps communicating where this feature is coming from.\n3. Commit your changes (`git commit -am 'Fix #444: Add support to REST-APIs'`)\n * Adding \"fix #444\" will trigger a link to the GitHub issue #444.\n4. Push to the branch (`git push feature/issue-444-Add-Rest-APIS`)\n5. Create new Pull Request as indicated by this page or your forked repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fnode-newrelic-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcellodesales%2Fnode-newrelic-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcellodesales%2Fnode-newrelic-api/lists"}