{"id":18542179,"url":"https://github.com/heremaps/here-tracking-js","last_synced_at":"2025-04-09T18:31:36.582Z","repository":{"id":35095673,"uuid":"206039756","full_name":"heremaps/here-tracking-js","owner":"heremaps","description":"JS library for accessing the HERE Tracking API","archived":false,"fork":false,"pushed_at":"2023-01-06T02:07:13.000Z","size":1665,"stargazers_count":15,"open_issues_count":18,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T10:21:17.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tracking.here.com/","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/heremaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-03T09:27:57.000Z","updated_at":"2022-12-27T15:55:29.000Z","dependencies_parsed_at":"2023-01-15T13:45:34.229Z","dependency_job_id":null,"html_url":"https://github.com/heremaps/here-tracking-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-tracking-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-tracking-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-tracking-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-tracking-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heremaps","download_url":"https://codeload.github.com/heremaps/here-tracking-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087763,"owners_count":21045586,"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-06T20:07:39.065Z","updated_at":"2025-04-09T18:31:31.567Z","avatar_url":"https://github.com/heremaps.png","language":"JavaScript","readme":"# HERE Tracking JS Library\n\nThis library simplifies access to [HERE Tracking](https://tracking.here.com). It can be used to create management consoles, monitoring interfaces and general device interfaces.\n\nIt can also be used to act as a virtual device and post telemetry to HERE Tracking.\n\nYou can find more information on the tracking platform here: [HERE Tracking Developer Guide](https://developer.here.com/documentation/tracking/index.html).\n\nThe compiled library is built for the last 2 versions of each major browser and IE 11.\n\n## Prerequisites\n\nThis is a Node.js and browser module available through the [npm registry](https://npmjs.com).\n\nTo build and develop this library, [download and install Node.js](https://nodejs.org/en/download/).\n\nInstallation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally).\n\n## Install\n\n    npm install @here/tracking-js\n\n## Directory Layout\n\nHere is an overview of the top-level files contained in the repository:\n\n    |\n    +- demo   # Examples of how to use this library to create a management interface or a virtual device\n    |\n    +- docs   # (generated using 'npm run docs') Description of each class and method in the library\n    |\n    +- lib    # (generated using 'npm run build') Compiled and minified files\n    |\n    +- src    # Original source for each module\n    |   |\n    |   +- aliases.js           # Create and retrieve retrieve aliases associated with a trackingId\n    |   |\n    |   +- associations.js      # Manage associations between devices and other entities\n    |   |\n    |   +- device.js            # Use to create a virtual device\n    |   |\n    |   +- devices.js           # Access device management endpoints\n    |   |\n    |   +- events.js            # View details about events created by devices and rules\n    |   |\n    |   +- geofences.js         # Create and manage geofences\n    |   |\n    |   +- index.js             # Main HERETracking class\n    |   |\n    |   +- journeys.js          # Create and manage journey templates.\n    |   |\n    |   +- messages.js          # Error messages\n    |   |\n    |   +- metadata.js          # Create and retrieve retrieve metadata associated with a trackingId\n    |   |\n    |   +- notifications.js     # Subscribe to/unsubscribe from notification channels\n    |   |\n    |   +- rules.js             # Defining and manage sensor rules\n    |   |\n    |   +- shadows.js           # Manage device data\n    |   |\n    |   +- traces.js            # Access device trace history\n    |   |\n    |   +- transitions.js       # Access device transition history\n    |   |\n    |   +- users.js             # Manage user details\n    |   |\n    |   +- vendors.js           # Create and manage device licences\n    |\n    +- test   # Test cases\n\n## Usage\n\n### HTML\n\nInclude the minified file in your HTML:\n\n    \u003cscript src=\"https://unpkg.com/@here/tracking-js@2.0.40/lib/HERETracking.min.js\"\u003e\u003c/script\u003e\n\n### Node.JS\n\n    const HERETracking = require('@here/tracking-js');\n\n### HTML and Node.JS\n\nCreate a new HERETracking object:\n\n    const tracking = new HERETracking();\n\nThen set the environment you want to run against. The options are 'cit' (Customer Integration Testing) or 'production'.\n\n    tracking.environment = 'production';\n\n## Tests\n\n    npm run test\n\n## Example Methods\n\nLog in a user:\n\n    tracking.users.login('email@example.com', 'password123')\n        .then(loginData =\u003e {\n            console.log(loginData);\n        });\n\n    \u003e {\"accessToken\": \"h1.userTokenHere...\", ...}\n\nList a user's registered devices:\n\n    tracking.users.listDevices({ token: 'h1.userTokenHere' })\n        .then(devices =\u003e {\n            console.log(devices);\n        });\n\nRetrieve a device's shadow (see [HERE Tracking Developer Guide - Shadows](https://developer.here.com/documentation/tracking/topics/shadows.html)):\n\n    tracking.shadow.get('trackingIdHere', { token: 'h1.userTokenHere' })\n        .then(deviceShadow =\u003e {\n            console.log(deviceShadow);\n        })\n\nLog in a virtual device:\n\n    tracking.device.login('deviceId', 'deviceSecret'})\n        .then(deviceLoginData =\u003e {\n            console.log(deviceLoginData);\n        });\n\n## HERE Account\n\nA valid HERE Account user `accessToken` is required to perform any user-related actions. This token is returned following a successful login using a HERE Account email and password. See 'Log in a user' above. Visit [account.here.com](https://account.here.com/) to register a new user account.\n\n## API Reference\n\nFull auto-generated documentation will be available in the `docs` folder after running\n\n    npm run docs\n\n## Example Application\n\nThere is an example web interface project available in the `demo` folder.\n\n\u003e #### Note\n\n\u003e You will need to register on [developer.here.com](http://developer.here.com) to get an `app_id` and `app_code` in order to be able to see map tiles.\n\nRename the file `credentials.default.js` to `credentials.js` and enter your `app_id` and `app_code`.\n\nTo start the demo just open `demo/index.html` in Chrome or Firefox. You'll need to run a local server to use the demo files in other browsers due to local file security restrictions.\n\n### demo/index.html\n\nThis will ask you to log into your HERE account then list any devices you have claimed to you account. Clicking on a trackingId will show you the last reported location of the device.\n\n### demo/embed.html\n\nA single-device view that can be embedded into another page. In addition to the map tile credentials, you must also enter a `username`, `password` and `trackingId` to see the device's position.\n\n### demo/device.html\n\nA virtual device that acts as a tracker, using the browser's Geolocation API as the location to send to HERE Tracking. You must enter a [device license](https://developer.here.com/documentation/tracking/topics/device-license.html.) generated on [https://app.tracking.here.com](app.tracking.here.com) into the form fields.\n\n#### Generating a Device License\n\n 1. Visit [https://app.tracking.here.com](app.tracking.here.com)\n 2. Log in or register a HERE Account via [developer.here.com](http://developer.here.com)\n 3. Select 'Add device'\n 4. Select 'Register a new device ID'\n 5. Copy the deviceId and deviceSecret into `device.html`\n\n## Building this Library\n\nThis is not necessary if you just want to use the SDK. If you want to build from source, though:\n\n    npm install\n    npm run dev\n    npm run test\n\nBuild the final (minified) version using\n\n    npm run build\n\nBuild the [ESDoc](https://esdoc.org/) docs using:\n\n    npm run docs\n\n## How can I contribute?\n\nYou want to contribute to this library? Welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nCopyright (C) 2017-2019 HERE Europe B.V.\n\nMIT license, see the [LICENSE](LICENSE) file in the root of this project for license details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fhere-tracking-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheremaps%2Fhere-tracking-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fhere-tracking-js/lists"}