0.1.2 • Published 5 years ago

trust-my-travel v0.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

Trust My Travel - Unofficial SDK

npm npm

Unofficial SDK maintained by the team at Skyhook.

This package is in ALPHA.

Setup

Install

npm install trust-my-travel

Initialise

const tmt = require("trust-my-travel")({
  url: "https://tmtprotects.com/unique-name",
  username: "abc",
  password: "def"
});

Use

A camelCase function is provided for each endpoint on the tmt object, with parameters item_id and options (both if required). Options should be passed through as an object, with key names matching those from the official Trust my Travel API docs.

All functions are promisified, for ES8 async/await use.

Examples

Note: All examples assume code is within an async function.

Sites

Create permitted urls
const permitted_urls = ["https://www.example.com", "https://www.example2.com"];
const res = await tmt.updatePermittedUrls(siteId, permitted_urls);
List sites
const sites = await tmt.listSites();
0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago