UNPKG

ifttt-webhooks-channel

Version:

Tiny package to trigger an IFTTT event using the webhooks channel

25 lines (22 loc) 447 B
function createUrl (eventName, key) { return `https://maker.ifttt.com/trigger/${eventName}/with/key/${key}` } function createRequestOptions (method, value) { return { method, body: value ? JSON.stringify({ value1: value[0], value2: value[1], value3: value[2] }) : '', headers: { 'Content-Type': 'application/json' } } } export default { createUrl, createRequestOptions }