# tractive

> A Tractive API wrapper, using tractive.com services.

Latest version **1.2.1** (published 2022-12-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install tractive
pnpm add tractive
yarn add tractive
bun add tractive
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2022-12-24 |
| First published | 2022-11-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 61 |
| Author | Weblutions |
| Maintainers | faxes |
| Keywords | tractive, tracking, GPS |

## Links

- npm: https://www.npmjs.com/package/tractive
- Repository: https://github.com/FAXES/tractive
- Homepage: https://github.com/FAXES/tractive#readme
- Issues: https://github.com/FAXES/tractive/issues
- npm.io page: https://npm.io/package/tractive

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.2.1 (latest) — 2022-12-24
- 1.2.0 — 2022-12-24
- 1.0.1 — 2022-12-02
- 1.0.0 — 2022-12-02
- 0.0.1 — 2022-11-27

## README

This is a simple Tractive GPS tracker API wrapper to make multiple types of requests to Tractive and recieve data on your account and pet(s).

### Contents
- [Getting Started](#Getting-Started)
- [All functions](#All-Functions)
- [Other](#Other)

### Getting Started

```js
const tractive = require('tractive');

/*
Check if Tractive has authenticated:
Return true if successful and connected or returns false is not connected.
*/
tractive.connect('TRACTIVE_ACCOUNT_EMAIL', 'TRACTIVE_ACCOUNT_PASSWORD')

/*
Check if Tractive has authenticated:
Returns true if the tractive.connect() is successful and connected.
*/
tractive.isAuthenticated() ? true : false;

tractive.getAllTrackers().then(function(trackers) {
    /*
    trackers = [
        {
            "_id":"ABCDEFGH",
            "_type":"tracker",
            "_version":"0000000e-0000000-0000000000"
        }
    ]
    */
});

/*
Gets a defined tracker and returns its latest report data along with address.
*/
tractive.getTrackerLocation("ABCDEFGH").then(function(tracker) {
    /*
    tracker = {
        time: 1669530259,
        time_rcvd: 1669530274,
        sensor_used: 'GPS',
        pos_status: [ 'STATIONARY_FIX' ],
        latlong: [ -30.234736, 129.16563 ],
        speed: 0,
        pos_uncertainty: 14,
        _id: 'ABCDEFGH',
        _type: 'device_pos_report',
        _version: '4daf8f322',
        altitude: 121,
        report_id: '00000000000000',
        nearby_user_id: null,
        power_saving_zone_id: null,
        address: {
            street: 'My Street Road',
            house_number: '10',
            zip_code: '0000',
            city: 'Anyville',
            country: 'AU',
            full_address: 'My Street Road 10, 0000 Anyville'
        }
    }
    */
});

// Turn on live tracking
tractive.liveOn("ABCDEFGH").then(function(tracker) {
    /*
    tracker = {
        active: false,
        started_at: null,
        timeout: 300,
        remaining: 0,
        pending: true,
        reconnecting: false
        }
    */
});
```

### All Functions

```js
getAccountInfo()
getAccountSubscriptions()
getAccountSubscription(subscriptionID)
getAccountShares()

getPets()
getPet(PetID)

getAllTrackers()
getTracker(trackerID)
getTrackerHistory(trackerID, from, to) // 'from' and 'to' are Date() functions or timestamps (in ms).
getTrackerLocation(trackerID) // Get the latest report that the tracker uploaded.
getTrackerHardware(trackerID) // Get the latest hardware report that was sent. This includes battery levels.

liveOn(trackerID) // Turns on live tracking
liveOff(trackerID) // Turns off live tracking
LEDOn(trackerID) // Turns on LED light
LEDOff(trackerID) // Turns off LED light
buzzerOn(trackerID) // Turns on buzzer sound
buzzerOff(trackerID) // Turns off buzzer sound
```

---

### Other

- [Suggest a new feature](https://github.com/FAXES/tractive/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)
- [Let us know of an issue](https://github.com/FAXES/tractive/issues/new?assignees=&labels=bug&template=bug_report.md&title=)

Created by [Weblutions](https://weblutions.com)

**Disclaimer**
*This personal project is maintained in spare time and has no business goal. Terms and logos related to Tractive are respective of their holders. This is not maintained or created by Tractive.*
<small>However, Tractive you're welcome to have the package name if you ever have an official API 💖</small>

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