trust-my-travel

0.1.2 • Public • Published

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();

/trust-my-travel/

    Package Sidebar

    Install

    npm i trust-my-travel

    Weekly Downloads

    8

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    190 kB

    Total Files

    26

    Last publish

    Collaborators

    • alan-cooney