Socket
Book a DemoInstallSign in
Socket

muthofun-sms-api

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

muthofun-sms-api

A class for sending SMS notifications via an HTTP API.

3.0.5
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

  • options - An object with the following properties:
  • authToken - The authorization token for the API.
  • apiUrl - The URL of the API endpoint.
  • async sendSMSNotification(msg: string, phone: string): Promise Sends an SMS notification via an HTTP API.
  • msg - The content of the SMS notification.
  • 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.

FAQs

Package last updated on 23 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.