3.0.5 • Published 1 year ago

muthofun-sms-api v3.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Muthofun-SMSNotifier

A class for sending SMS notifications via an HTTP API.

Installation

npm install muthofun-sms-api

Usage

import SMSNotifier from 'muthofun-sms-api';

const notifier = new SMSNotifier({ authToken: 'my-auth-token', apiUrl: 'https://sysadmin.muthobarta.com', });

notifier.sendSMSNotification('Hello, world!', '+1234567890') .then(() => { console.log('SMS notification sent'); })
.catch((err) => { console.error(`Error sending SMS notification: ${err.message}`); });

The SMSNotifier class takes an object with authToken and apiUrl properties as its constructor argument. You can then call the sendSMSNotification method with the message content and phone number as its arguments. The method returns a Promise that resolves when the SMS notification has been sent, or rejects with an error if there is a problem sending the notification.

API

new SMSNotifier(options: SMSNotificationOptions) Creates a new instance of the SMSNotifier class.

  1. options - An object with the following properties:
  2. authToken - The authorization token for the API.
  3. apiUrl - The URL of the API endpoint.
  4. async sendSMSNotification(msg: string, phone: string): Promise Sends an SMS notification via an HTTP API.
  5. msg - The content of the SMS notification.
  6. phone - The phone number to send the notification to.

Returns a Promise that resolves when the SMS notification has been sent, or rejects with an error if there is a problem sending the notification.

License

This package is licensed under the MIT License.

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago