Skip to content

Latest commit

 

History

History
66 lines (50 loc) · 2.18 KB

README.md

File metadata and controls

66 lines (50 loc) · 2.18 KB



@mulgul/garmin-wrapper-ts

Typescript API wrapper for the Garmin IPCBound API

npm Github Actions GPL-3.0-or-later



Thw following library is wrapper around the Garmin IPCBound API. Garmin has two specific API's - The IPC Inbound API, and the IPC Outbound API. This API focuses on giving the tools to access these exact api's with ease. Currently this wrapper focuses on Inbound requests. Outbound service requires more than the scope of this library offers.

How to

InboundGarminWrapper

import { InboundGarminWrapper } from '@mulgul/garmin-wrapper-ts';

const credentials = {
    username: process.env.USERNAME,
    password: process.env.PASSWORD
};
const ipcUrl = process.env.IPCURL;
const imei = process.env.IMEI;

const api = new InboundGarminWrapper(ipcUrl, credentials, imei);

let data;
try {
    data = await api.getTrackingVersion();
} catch (e) {
    console.error(e)
}

options

All api calls take in an option param of type RequestInit. These contain basic header options etc.

await api.getTrackingVersion({
    body: 'foo',
    headers: {
        ...
    }
});

About this repository

License

The source code in this repository is distributed under the Apache-2.0 license. See the file.

This source code comes with absolutely no warranty. Use at your own risk.