Send IFTTT Webhook (Deno)

License GitHub Repository GitHub Stars GitHub Contributors GitHub Issues GitHub Pull Requests GitHub Discussions CodeFactor Grade

Releases Latest (GitHub Latest Release Date) Pre (GitHub Latest Pre-Release Date)
Deno Land
GitHub GitHub Total Downloads GitHub Latest Release Version GitHub Latest Pre-Release Version

📝 Description

A Deno module to send IFTTT webhook.

🔗 Other Edition:

📚 Documentation

Getting Started

  • Deno >= v1.34.0
/* Either */
import { ... } from "https://deno.land/x/send_ifttt_webhook/mod.ts";// Named Import
import * as iftttWebhook from "https://deno.land/x/send_ifttt_webhook/mod.ts";// Namespace Import
import IFTTTWebhook from "https://deno.land/x/send_ifttt_webhook/mod.ts";// Default Import (Class `IFTTTWebhook`)

API

Class

  • new IFTTTWebhook(key: string, options: IFTTTWebhookConstructorOptions = {}): IFTTTWebhook;
      .send(options: IFTTTWebhookSendOptions = {}): Promise<Response>;
      .sendArbitrary(options: Omit<IFTTTWebhookSendOptions, "arbitrary"> = {}): Promise<Response>;
    
    IFTTTWebhook.send(key: string, eventName: string, options: Omit<IFTTTWebhookSendOptions, "eventName"> = {}): Promise<Response>;
    IFTTTWebhook.sendArbitrary(key: string, eventName: string, options: Omit<IFTTTWebhookSendOptions, "arbitrary" | "eventName"> = {}): Promise<Response>;

Function

  • send(key: string, eventName: string, options: Omit<IFTTTWebhookSendOptions, "eventName"> = {}): Promise<Response>;
  • sendArbitrary(key: string, eventName: string, options: Omit<IFTTTWebhookSendOptions, "arbitrary" | "eventName"> = {}): Promise<Response>;

Interface / Type

  • interface IFTTTWebhookConstructorOptions {
      /* Define a default value of whether to trigger with an arbitrary payload. */
      arbitraryDefault: boolean = false;
      /* Define a default value of the event name. */
      eventNameDefault?: string;
    }
  • interface IFTTTWebhookSendOptions {
      /* Whether to trigger with an arbitrary payload. */
      arbitrary: boolean = arbitraryDefault;
      /* Event name. */
      eventName: string = eventNameDefault;
      /* Payload. */
      payload: object = {};
    }

Example

new IFTTTWebhook("my-ifttt-webhook-key", { eventNameDefault: "test" }).sendArbitrary({ payload: { message: "Hello, world!" } })