0.1.11 • Published 2 years ago

adasms-sdk v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Test CI GitHub release License issues - adasms-sdk

adasms-sdk

This is Non-Official a AdaSMS SDK.

https://nodei.co/npm/adasms-sdk.png?downloads=true&downloadRank=true&stars=true

StatementsBranchesFunctionsLines
StatementsBranchesFunctionsLines

AdaSMS

The Best SMS Provider for Business Adasms gives you the best for business experience with all the features you need. The days of overpriced SMS is over, our price is as low as MYR 0.08/SMS to all networks. Free to register and no account fees.

Sign-up at https://terminal.adasms.com/register and get started as low as MYR 10.00!

MYR 10 = 10,000 Credits

MYR 50 = 50,000 Credits

Features/Functions

  • Rate: MYR 0.08/SMS to all networks
  • Core Functions:
    • sendSMS()
    • getCreditBalance()
    • listScheduledMessage()
    • deleteScheduledMessage()
  • Phonebook Features:
    • createLead()
    • getLeads()
    • deleteLead()
    • createContact()
    • getContactList()
    • deleteContact()

Installing

Environment Variable

.env

ADASMS_APPLICATION_SECRET=<your-adasms-application-secret>

Package Manager

Using npm:

$ npm install adasms-sdk

Using bower:

$ bower install adasms-sdk

Using yarn:

$ yarn add adasms-sdk

Using pnpm:

$ pnpm add adasms-sdk

Once the package is installed, you can import the library using import or require approach:

import { Client } from 'adasms-sdk'

You can also use the default export, since the named export is just a re-export from the adasms-sdk factory:

import Client from 'adasms-sdk'

If you use require for importing, only default export is available:

const Client = require('adasms-sdk')

Example

es6

import { Client } from 'adasms-sdk'

const client = new Client()
/**
 *  If you prefer to hardcode token (not secure)
 *  const client = new Client({ token: <your-adasms-application-secret> })
 */

const response = await client.getCreditBalance()
console.log(response.balance)
// output: { balance: 10000 }

Typescript

import Client, { ClientOption, SendSMSObject } from 'adasms-sdk'

const option: ClientOption = {
    token: process.env.ADASMS_APPLICATION_SECRET
}
const client = new Client(option)

const params: SendSMSObject = {
    phone: "60199126212",
    message: "Hello from adasms-sdk",
    previewMode: true, // dry-run
}
const response = await client.sendSMS()
console.log(response)
/**
 * { "success": true, 
 *      "message": {
 *          "message": "Hello from @adasms\/client",
 *          "price": 80,
 *          "length": 25,
 *          "total_sent": 1,
 *          "recipients": 1,
 *          "phones": ["+60199126212"],
 *          "message_per_recipient": 1,
 *          "send_at": null,
 *          "lead_id": null,
 *          "preview": true
 *      }
 *  }
 */ 

Contributing

I am open to, and grateful for, any contributions made by the community. By contributing to this repo, you agree to abide by the code of conduct.

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago