Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
kavenegar-api
Advanced tools
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.
npm install --save kavenegar-api
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 });
async function testConnection() {
const date = await kavenegar.getDate();
console.log('Connection successful. Current date:', date.datetime);
}
async function sendSingleSMS() {
const message = 'Hello, world!';
const receptor = 'RECIPIENT_NUMBER';
const result = await kavenegar.send({ message, receptor });
console.log('Single SMS sent:', result);
}
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);
}
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);
}
async function checkSMSStatus() {
const messageIds = [1234567890, 9876543210]; // Replace with actual message IDs
const status = await kavenegar.status({ messageid: messageIds });
console.log('SMS Status:', status);
}
async function cancelSMSSending() {
const messageId = 1234567890; // Replace with actual message ID
const result = await kavenegar.cancel({ messageid: messageId });
console.log('SMS Cancelled:', result);
}
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);
}
async function getAccountInfo() {
const accountInfo = await kavenegar.accountInfo();
console.log('Account Information:', accountInfo);
}
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);
}
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);
}
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.
0.1.0
FAQs
kavenegar sms provider api
The npm package kavenegar-api receives a total of 9 weekly downloads. As such, kavenegar-api popularity was classified as not popular.
We found that kavenegar-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.