npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smsquick

v1.0.1

Published

A Node.js library for sending SMS through multiple providers.

Downloads

24

Readme

📦 smsQuick - Multi-Provider SMS Sending Library

**smsQuick** simplifies integration with various SMS providers for Node.js applications. This library allows you to send SMS messages quickly and efficiently with just a few lines of code.

📋 Table of Contents


📦 Installation

Add smsQuick to your project using npm:

npm install smsQuick

🛠 Usage

1. Import the Library

const smsQuick = require('smsQuick');

2. Configure the Provider

Here's how you can configure the twilio provider:

const sms = smsQuick.init({
    provider: 'twilio', // Supported providers: netgsm, twilio, iletimerkezi, vatansms, vonage
    accountSid: 'your_account_sid',
    authToken: 'your_auth_token',
    from: 'your_phone_number'
});

3. Send an SMS

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello, this is a test message!'
}).then(response => {
    console.log(response); // { status: true, message: 'SMS sent successfully' }
}).catch(error => {
    console.error(error); // Error handling
});

🗂 Supported Providers

1. Netgsm

  • URL: https://api.netgsm.com.tr/sms/send/get
  • Required Parameters: header, username, password

2. Twilio

  • URL: Twilio API
  • Required Parameters: accountSid, authToken, from

3. Iletimerkezi

  • URL: https://api.iletimerkezi.com/v1/send-sms/get/
  • Required Parameters: apiKey, apiHash, from

4. Vatansms

  • URL: https://api.vatansms.net/api/v1/1toN
  • Required Parameters: apiId, apiKey, sender

5. Vonage

  • URL: Vonage API
  • Required Parameters: apiKey, apiSecret, from

🎯 Example Usage

Netgsm

const sms = smsQuick.init({
    provider: 'netgsm',
    header: 'your_header',
    username: 'your_username',
    password: 'your_password'
});

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello from Netgsm!'
});

Twilio

const sms = smsQuick.init({
    provider: 'twilio',
    accountSid: 'your_account_sid',
    authToken: 'your_auth_token',
    from: 'your_phone_number'
});

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello from Twilio!'
});

Iletimerkezi

const sms = smsQuick.init({
    provider: 'iletimerkezi',
    apiKey: 'your_api_key',
    apiHash: 'your_api_hash',
    from: 'your_sender_name'
});

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello from Iletimerkezi!'
});

Vatansms

const sms = smsQuick.init({
    provider: 'vatansms',
    apiId: 'your_api_id',
    apiKey: 'your_api_key',
    sender: 'your_sender_name'
});

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello from Vatansms!'
});

Vonage

const sms = smsQuick.init({
    provider: 'vonage',
    apiKey: 'your_api_key',
    apiSecret: 'your_api_secret',
    from: 'your_phone_number'
});

sms.send({
    to: 'recipient_phone_number',
    message: 'Hello from Vonage!'
});

📬 Response Formats

Each provider may return different response formats. Here are common examples:

Successful Response

{
    "status": true,
    "message": "SMS sent successfully"
}

Failed Response

{
    "status": false,
    "message": "SMS could not be sent"
}

Responses may vary by provider. Check their API documentation and review the responses using console.log to handle them appropriately.


🐞 Troubleshooting

  • Missing Parameters: If you receive status: false, message: 'Missing parameters', ensure all required parameters are provided.
  • Network Errors: Network issues or API errors generally return status: false, message: 'SMS could not be sent'. Check your API keys and network connection.
  • Response Errors: Different providers use different response formats. Examine the responses with console.log to diagnose issues.

💪 Contributors


📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.


With **smsQuick**, sending SMS is now simpler and faster! 🚀


GitHub: fastuptime/smsQuick
npm: smsQuick