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

kasa-js

v1.0.5

Published

This package enables sending of sms from your javascript application using http://kasa.philangie.com as a service provider.

Downloads

4

Readme

Please note: This library is a forked version of the main library arkesel-js. This is to enable us utilize the kasa platform. I do not own the rights to this library.

Kasa SMS Javascript Library

This package enables sending of sms from your javascript application using Kasa as a service provider.

Requirements & Installation

You can install the package via npm:

npm install kasa-js

Setting API key in .env file

Before you can start sending sms you will need to set your api key and default sender ID in your /.env file You can find your api key here http://kasa.philangie.com/user/sms-api/info These config files can be changed from the laravel application.

KASA_SMS_SENDER_ID=MyApp
KASA_SMS_API_KEY=YourKeyGoesHere

Usage Examples

const Kasa from "kasa-js";

const sms = new Kasa("SenderId", "smsApiKey");

Basic sending(uses api_key set in .env file)

// successful response: {"code":"ok","message":"Successfully Send","balance":58995,"user":"Adinkra Pie"}
// error response: {"code":"102","message":"Authentication Failed"}
sms.send('02XXXXXXXXX', 'Your pie will be ready in 5 mins', timestamp = 'In case you want to schedule',
        (callback) => // console.log(callback)
    );

To use a different api key at runtime

sms.withFreshApiKey('API_KEY_GOES_HERE').send('02XXXXXXXX', 'We want to confirm your destination. Adum post office right?', null,
        (callback) => // console.log(callback)
    );

To customise sender Id (must not be more than 11 characters)

sms.from('CompanyName').send('02XXXXXXXX', 'Your pie is ready for dispatch.', null,
        (callback) => // console.log(callback)
    );

Sceduling (sending message at a later time)

// successful response: {"code":"109","message":"Invalid Schedule Time"}
// successful response: {"code":"ok","message":"SMS Scheduled successfully.","balance":58995,"user":"Adinkra Pie"}
const dateTime ='04-05-2020 06:19 PM'; // Must be this format - "d-m-Y h:i A"
sms.schedule(dateTime, '02XXXXXXXX', 'We have arrived at your destination.',
        (callback) => // console.log(callback)
    )

Checking Sms balance

// successful response: {"balance":58995,"user":"Adinkra Pie","country":"Ghana"}
sms.balance((callback) => console.log(callback));

Check balance of a different a kasa account account

sms.withFreshApiKey('API_KEY_GOES_HERE')balance(
        (callback) => // console.log(callback)
    );

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.