{"id":21522194,"url":"https://github.com/greguz/node-bungie-net-api","last_synced_at":"2025-10-11T19:15:32.702Z","repository":{"id":62825895,"uuid":"543064628","full_name":"greguz/node-bungie-net-api","owner":"greguz","description":"Yet another Bungie.NET API client for Node.js","archived":false,"fork":false,"pushed_at":"2022-12-18T19:24:15.000Z","size":480,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T16:54:41.028Z","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/greguz.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":"2022-09-29T10:41:14.000Z","updated_at":"2022-10-24T03:28:27.000Z","dependencies_parsed_at":"2023-01-29T19:45:52.934Z","dependency_job_id":null,"html_url":"https://github.com/greguz/node-bungie-net-api","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greguz%2Fnode-bungie-net-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greguz%2Fnode-bungie-net-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greguz%2Fnode-bungie-net-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greguz%2Fnode-bungie-net-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greguz","download_url":"https://codeload.github.com/greguz/node-bungie-net-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075659,"owners_count":20393980,"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-11-24T01:09:34.205Z","updated_at":"2025-10-11T19:15:27.682Z","avatar_url":"https://github.com/greguz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-bungie-net-api\n\n[![npm](https://img.shields.io/npm/v/bungie.net)](https://www.npmjs.com/package/bungie.net)\n![NPM](https://img.shields.io/npm/l/bungie.net)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nYet another Bungie.NET API client for Node.js\n\n## Features\n\n- **OAuth support**\n- **Support both Private and Public Apps**\n- **Automatic token refresh**\n- **TypeScript support**\n- **Full API surface**: all API are dynamically generated using the official [OpenAPI](https://github.com/Bungie-net/api) specs file.\n\n## OpenAPI\n\nAll API methods' are dynamically generated from the official OpenAPI specs.\nThe currenctly used specs file is also included inside this repository for preservation.\n\n**Current version**: v2.17.0\n\n## Install\n\n```\nnpm install bungie.net\n```\n\n## Documentation\n\n- See the [API documentation](./docs/BungieApi.md).\n\n## Example\n\n```javascript\nimport { BungieApi, DestinyComponentType } from 'bungie.net'\n\nconst api = new BungieApi({\n  apiKey: 'myapikey',\n  clientId: 'myclientid',\n  clientSecret: 'myclientsecret'\n})\n\nasync function foo () {\n  // This request does not require user authorization\n  const manifest = await api.destiny2.getDestinyManifest()\n\n  // Redirect the user to this url...\n  const url = api.getAuthorizationUrl('MySecretState')\n\n  // Wait for callback with the authorization code and your state...\n  const code = 'CallbackRequestQuerystringCode'\n\n  await api.authorize(code)\n\n  console.log(api.accessToken.raw) // raw token value\n  console.log(api.accessToken.expires) // expiration date (ms)\n  console.log(api.accessToken.expired) // false\n\n  if (api.refreshToken) {\n    // If the app is private and everything is configured correctly,\n    // you'll also get a refresh token from the authorization request\n    console.log(api.refreshToken.raw)\n    console.log(api.refreshToken.expires)\n    console.log(api.refreshToken.expired)\n  }\n\n  // Having an access token, you can request protected resources\n  const memberships = await api.user.getMembershipDataForCurrentUser()\n\n  const membershipType = memberships.destinyMemberships[0].membershipType\n  const membershipId = memberships.destinyMemberships[0].membershipId\n\n  // Get characters from the current authorized profile\n  const characters = await api.destiny2.getProfile(\n    membershipType,\n    membershipId,\n    {\n      components: [\n        DestinyComponentType.Characters\n      ]\n    }\n  )\n\n  // Grab first characted data\n  const characterId = Object.keys(characters.characters.data)[0]\n  const characterData = characters.characters.data[characterId]\n\n  // Banshee\n  const vendorHash = '672118013'\n\n  // Get vendor data\n  const vendorData = await api.destiny2.getVendor(\n    membershipType,\n    membershipId,\n    characterId,\n    vendorHash,\n    {\n      components: [\n        DestinyComponentType.VendorSales,\n        DestinyComponentType.ItemPerks\n      ]\n    }\n  )\n}\n\nfoo().catch(err =\u003e console.error(err))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreguz%2Fnode-bungie-net-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreguz%2Fnode-bungie-net-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreguz%2Fnode-bungie-net-api/lists"}