# hypertrack-node

> HyperTrack Node bindings

Latest version **3.0.0** (published 2018-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install hypertrack-node
pnpm add hypertrack-node
yarn add hypertrack-node
bun add hypertrack-node
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2018-04-21 |
| First published | 2017-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6.9 |
| Dependencies | 1 |
| Unpacked size | 847.7 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | HyperTrack |
| Maintainers | gaurav.mk, rishabhgrg |

## Links

- npm: https://www.npmjs.com/package/hypertrack-node
- Repository: https://www.github.com/hypertrack/hypertrack-node-sdk
- npm.io page: https://npm.io/package/hypertrack-node

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) 0.16.2

## Recent versions

- 3.0.0 (latest) — 2018-04-21
- 2.2.0 — 2017-11-18
- 2.1.1 — 2017-11-16
- 2.1.0 — 2017-10-18
- 2.0.1 — 2017-10-18
- 2.0.0 — 2017-09-08
- 1.0.0 — 2017-09-08
- 0.0.1 — 2017-09-08

## README

HyperTrack Node Bindings
==========================
[![npm version](https://badge.fury.io/js/hypertrack-node.svg)](https://badge.fury.io/js/hypertrack-node)
[![Slack Status](http://slack.hypertrack.io/badge.svg)](http://slack.hypertrack.io)

Node bindings for [HyperTrack APIs](https://docs.hypertrack.com/api/entities/).

Installation
------------
```
npm install hypertrack-node --save
```

Usage
------

You'll need your HyperTrack secret key to initialize the client. You can find this from your [account page](https://dashboard.hypertrack.com/settings) on HyperTrack Dashboard. To get started -

* Initialize the client with secret key in your file:

```javascript
var hypertrack = require('hypertrack-node').hypertrack('<YOUR HYPERTRACK SECRET KEY>');
```
* Start making API calls
```javascript
hypertrack.{RESOURCE_NAME}.{METHOD_NAME}
```
Entities
-----------
The library supports all the following entities. Use the links to find a detailed list of possible API calls for each one of them.

| Entity | Description | Method Access |
|--------|-------------|-----------|
| [User](https://docs.hypertrack.com/api/entities/user.md) | Represents the person who is being tracked | hypertrack.users
| [Action](https://docs.hypertrack.com/api/entities/action.md) | Represents a transaction event (e.g., pickup, delivery, visit, appointment, drop-off) being performed by the User | hypertrack.actions  |
| [Place](https://docs.hypertrack.com/api/entities/place.md) | Represents a place of interest that an User may visit, or where an Action is expected | hypertrack.places  |
| [Group](https://docs.hypertrack.com/api/entities/group.md) | Represents a collection of Users | hypertrack.groups  |
| [Event](https://docs.hypertrack.com/api/entities/event.md) | An incident happens in the life of your users | hypertrack.events  |
| [Geofence](https://docs.hypertrack.com/api/entities/geofence.md) | Set a geofence to be notified when User enters or leaves certain place | hypertrack.geofence  |

Every [resource method](https://github.com/hypertrack/hypertrack-node-sdk/tree/master/src/resources) returns a promise which can be used to chain multiple API calls as well as to catch any errors. For example, to create a user and assign action -

```javascript
hypertrack.users.create({
  name: 'John Smith',
  phone: '+16502469293'
}).then(function(user) {
  // Assign actions to this user
  hypertrack.users.assignAction(user.id, {"action_ids": ["123e4567-e89b-12d3-a456-426655440000"]})
}).error(function(err) {
  // Handle Error
});
```

Reference
-------------

For detailed documentation of the methods available, please visit the official [HyperTrack API documentation](https://docs.hypertrack.com/api/entities/).

---
_Source: https://npm.io/package/hypertrack-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
