2.0.0 • Published 10 months ago

ifttt-webhooks-channel v2.0.0

Weekly downloads
133
License
ISC
Repository
github
Last release
10 months ago

ifttt-webhooks-channel

npm version Maintainability
Tiny package to trigger an IFTTT event using the webhooks channel

Table of contents

Installation

npm install ifttt-webhooks-channel

Usage

// Import the module in your project
import IFTTT from 'ifttt-webhooks-channel'

// Create a new IFTTT instance
const Ifttt = new IFTTT(key) // key is where your webhooks channel key goes

Methods

A list of methods that IFTTT contains

Post

Sends a post request to the webhooks channel to trigger an ifttt event.

Ifttt.post(eventName, value)
  .then(res => console.log(res))
  .catch(err => console.error(err))

eventName is the name of the event you should have created on the webhooks channel.
value should be an array containing at most 3 values. These can be used in the action you attatch to the event when it's triggered, e.g. a notification.

The function returns the response object if the post was succesful. If there was some kind of error it returns an error object.

Example

const IFTTT = require('ifttt-webhooks-channel')
const Ifttt = new IFTTT('your_webhooks_channel_key')

Ifttt.post('event_name', [
  'value 1',
  'item 2',
  'string 3'
])
  .then(res => console.log(res))
  .catch(err => console.error(err))
2.0.0

10 months ago

1.1.7

1 year ago

1.1.6

2 years ago

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago