
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
ippanel-node-sdk
Advanced tools
A Node.js SDK for interacting with the ippanel API to send various types of SMS messages.
Install the SDK using npm:
npm install ippanel-node-sdk
Or using yarn:
yarn add ippanel-node-sdk
First, import and instantiate the client with your API key:
// Using CommonJS
const { createClient } = require('ippanel-node-sdk');
const client = createClient('YOUR_API_KEY');
// Or using ES Modules
import { createClient } from 'ippanel-node-sdk';
const client = createClient('YOUR_API_KEY');
// Alternatively, you can use the Client class directly
const { Client } = require('ippanel-node-sdk');
const client = new Client('YOUR_API_KEY');
Send a simple message to one or more recipients:
client.sendWebservice(
'Hello from ippanel!',
'+983000505', // sender number
['+989123456789', '+989356789012'] // recipient numbers
)
.then(response => console.log('Message sent:', response))
.catch(error => console.error('Error sending message:', error));
Send a message using a predefined pattern:
client.sendPattern(
'YOUR_PATTERN_CODE',
'+983000505', // sender number
'+989123456789', // recipient number
{
param1: 'value1',
param2: 'value2'
} // pattern parameters
)
.then(response => console.log('Pattern message sent:', response))
.catch(error => console.error('Error sending pattern message:', error));
Send a verification OTP message:
client.sendVOTP(
123456, // OTP code
'+989123456789' // recipient number
)
.then(response => console.log('VOTP message sent:', response))
.catch(error => console.error('Error sending VOTP message:', error));
All methods return promises and can be used with async/await:
async function sendMessages() {
try {
// Send a web service message
const webResult = await client.sendWebservice(
'Hello from ippanel!',
'+983000505',
['+989123456789']
);
console.log('Web service result:', webResult);
// Send a pattern message
const patternResult = await client.sendPattern(
'PATTERN_CODE',
'+983000505',
'+989123456789',
{ name: 'John', code: '12345' }
);
console.log('Pattern result:', patternResult);
// Send a VOTP message
const votpResult = await client.sendVOTP(123456, '+989123456789');
console.log('VOTP result:', votpResult);
} catch (error) {
console.error('Error sending messages:', error);
}
}
You can specify a custom base URL when creating the client:
const client = createClient('YOUR_API_KEY', 'https://custom-api.example.com/v1/api');
You can customize the HTTP client settings:
const axios = require('axios');
const { createClient } = require('ippanel-node-sdk');
const client = createClient('YOUR_API_KEY');
// Create custom axios instance
const customAxios = axios.create({
timeout: 30000, // 30 seconds timeout
headers: {
'Authorization': client.apiKey,
'Content-Type': 'application/json',
'User-Agent': 'My Custom App'
}
});
// Set the custom HTTP client
client.setHttpClient(customAxios);
The SDK throws meaningful errors that you can catch and handle:
client.sendWebservice('Test message', '+983000505', ['+989123456789'])
.then(response => {
console.log('Success:', response);
})
.catch(error => {
if (error.message.includes('API Error:')) {
console.error('API returned an error:', error.message);
} else if (error.message === 'No response received from the API') {
console.error('Network or timeout issue');
} else {
console.error('Unexpected error:', error.message);
}
});
Successful responses have the following structure:
{
data: {
// Response data specific to the API endpoint
},
meta: {
status: true,
message: "Operation successful",
message_parameters: [],
message_code: "success"
}
}
The SDK includes TypeScript definitions for improved development experience with TypeScript.
import { createClient, SendResponse } from 'ippanel-node-sdk';
const client = createClient('YOUR_API_KEY');
async function sendSMS(): Promise<SendResponse> {
return client.sendWebservice('Hello', '+983000505', ['+989123456789']);
}
MIT
FAQs
Node.js SDK for ippanel API
The npm package ippanel-node-sdk receives a total of 17 weekly downloads. As such, ippanel-node-sdk popularity was classified as not popular.
We found that ippanel-node-sdk 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.