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 🙏

© 2026 – Pkg Stats / Ryan Hefner

kavenegar-api

v0.1.0

Published

kavenegar sms provider api

Readme

Kavenegar Node.js API Module

A zero-dependency TypeScript/JavaScript module for interacting with the Kavenegar API, allowing you to send SMS messages, manage message status, and perform other actions.

Installation

npm install --save kavenegar-api

Usage

Initialization

Replace 'YOUR_API_KEY' with your actual API key.

import { KavenegarApi } from 'kavenegar-api';
// OR
const { KavenegarApi } = require('kavenegar-api');

// Initialize the Kavenegar API with your API key
const apiKey = 'YOUR_API_KEY' || 0 // set apiKey to zero just for test connection;
const kavenegar = new KavenegarApi({ apiKey });

Get Current Date for testing connection

async function testConnection() {
    const date = await kavenegar.getDate();
    console.log('Connection successful. Current date:', date.datetime);
}

Send a Single SMS

async function sendSingleSMS() {
    const message = 'Hello, world!';
    const receptor = 'RECIPIENT_NUMBER';
    const result = await kavenegar.send({ message, receptor });
    console.log('Single SMS sent:', result);
}

Send Multiple SMS Messages

async function sendMultipleSMS() {
    const messages = ['Hello', 'Hi', 'Hey'];
    const receptors = ['RECIPIENT_1', 'RECIPIENT_2', 'RECIPIENT_3'];
    const senders = ['SENDER_1', 'SENDER_2', 'SENDER_3'];
    const result = await kavenegar.sendArray({ message: messages, receptor: receptors, sender: senders });
    console.log('Multiple SMS sent:', result);
}

Verify a Phone Number with a Token

async function verifyPhoneNumber() {
    const receptor = 'RECIPIENT_NUMBER';
    const token = '123456';
    const template = 'TEMPLATE_NAME';
    const result = await kavenegar.verifyLookup({ receptor, token, template });
    console.log('Verification result:', result);
}

Check SMS Status

async function checkSMSStatus() {
    const messageIds = [1234567890, 9876543210]; // Replace with actual message IDs
    const status = await kavenegar.status({ messageid: messageIds });
    console.log('SMS Status:', status);
}

Cancel SMS Sending

async function cancelSMSSending() {
    const messageId = 1234567890; // Replace with actual message ID
    const result = await kavenegar.cancel({ messageid: messageId });
    console.log('SMS Cancelled:', result);
}

Receive SMS

async function receiveSMS() {
    const lineNumber = 'YOUR_LINE_NUMBER'; // Replace with actual line number
    const isRead = 0; // 0 for unread, 1 for read
    const receivedMessages = await kavenegar.receive({ lineNumber, isRead });
    console.log('Received SMS:', receivedMessages);
}

Retrieve Account Information

async function getAccountInfo() {
    const accountInfo = await kavenegar.accountInfo();
    console.log('Account Information:', accountInfo);
}

Configure Account Settings

async function configureAccount() {
    const accountConfigs = {
        apilogs: 'enabled',
        dailyreport: 'disabled',
        debugmode: 'enabled',
        defaultsender: 'YOUR_SENDER_ID',
        mincreditalarm: 100,
        resendfailed: 'enabled'
    };
    const configuredSettings = await kavenegar.accountConfig(accountConfigs);
    console.log('Account Settings Configured:', configuredSettings);
}

Make Text-to-Speech Call

async function makeTTS() {
    const receptor = 'RECIPIENT_NUMBER';
    const message = 'Hello, this is a text-to-speech message.';
    const result = await kavenegar.callMakeTTS({ receptor, message });
    console.log('Text-to-Speech Call result:', result);
}

Other functions you can use

  • statusLocalMessageId
  • select
  • selectOutbox
  • latestOutbox
  • countInbox
  • countOutbox

Feel free to customize and expand these examples according to your needs!

This README provides clear instructions on how to use the Kavenegar API module and includes examples for some of its functions.

For more information, visit the Kavenegar official website.