trust-my-travel
v0.1.2
Published
Trust My Travel Unofficial SDK
Downloads
5
Readme
Trust My Travel - Unofficial SDK
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();