0.6.0 • Published 4 months ago
@hugoalh/send-ifttt-webhook v0.6.0
Send IFTTT Webhook (NodeJS)
Release - Latest | Release - Pre | |
---|---|---|
() | () | |
A NodeJS module to send IFTTT webhook.
🔰 Begin
Bun
🧪 Experimental: Bun is still under development.
- Target Version: ^ v1.0.0, &:
- TypeScript >= v5.1.0 [Development]
- Require Permission: N/A
- Domain/Registry:
- NPM
bun add @hugoalh/send-ifttt-webhook[@<Tag>]
import ... from "@hugoalh/send-ifttt-webhook[@<Tag>]";
- NPM
ℹ️ Notice: It is also able to import part of the module with sub path if available, see file
package.json
propertyexports
for available sub paths.
NodeJS
- Target Version: >= v18.12.0, &:
- TypeScript >= v5.1.0 [Development]
- Require Permission: N/A
- Domain/Registry:
- NPM
npm install @hugoalh/send-ifttt-webhook[@<Tag>]
import ... from "@hugoalh/send-ifttt-webhook";
- NPM
ℹ️ Notice: It is also able to import part of the module with sub path if available, see file
package.json
propertyexports
for available sub paths.
🧩 API
class IFTTTWebhook { constructor(key: string | URL, options: IFTTTWebhookOptions = {}): IFTTTWebhook; send(eventName: string, payload: IFTTTWebhookStandardPayload = {}): Promise<Response>; sendArbitrary(eventName: string, payload: JSONValueExtend = {}): Promise<Response>; static send(key: string | URL, eventName: string, payload: IFTTTWebhookStandardPayload = {}): Promise<Response>; static sendArbitrary(key: string | URL, eventName: string, payload: JSONValueExtend = {}): Promise<Response>; }
function sendIFTTTWebhook(key: string | URL, eventName: string, payload: IFTTTWebhookStandardPayload = {}): Promise<Response>;
function sendIFTTTWebhookArbitrary(key: string | URL, eventName: string, payload: JSONValueExtend = {}): Promise<Response>;
interface IFTTTWebhookStandardPayload { value1?: string; value2?: string; value3?: string; }
ℹ️ Notice: Documentation is included inside the script file.
✍️ Example
import { IFTTTWebhook } from "@hugoalh/send-ifttt-webhook"; new IFTTTWebhook("my-ifttt-webhook-key").sendArbitrary("test", { message: "Hello, world!" });