npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tractive

v1.2.1

Published

A Tractive API wrapper, using tractive.com services.

Downloads

13

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

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

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

Created by Weblutions

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. However, Tractive you're welcome to have the package name if you ever have an official API 💖