Socket
Book a DemoInstallSign in
Socket

arkesel-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arkesel-js

This package enables sending of sms from your javascript application using https://sms.arkesel.com as a service provider.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Arkesel SMS Javascript Library

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

Requirements & Installation

You can install the package via npm:

npm install arkesel-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 https://sms.arkesel.com/user/sms-api/info These config files can be changed from the laravel application.

ARKESEL_SMS_SENDER_ID=MyApp
ARKESEL_SMS_API_KEY=YourKeyGoesHere

Usage Examples

const Arkesel from "arkesel-js";

const sms = new Arkesel("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 arkesel account account

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

Security

If you discover any security related issues, please email nana.elvee@gmail.com instead of using the issue tracker.

License

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

Keywords

arkesel

FAQs

Package last updated on 14 Jan 2021

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.