Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
nimbasms
Advanced tools
Readme
A NodeJS module for communicating with Nimba SMS API.
npm install nimbasms
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
// Get your account balance
client.accounts.get()
.then(account => {
console.log(`My Account balance: ${account['balance']}`);
})
.catch(error => {
console.log(error);
})
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
client.groups.list()
.then(groups => {
console.log(`There are ${groups.count} groups.`);
// or
// console.log(`There are ${groups.results.length} groups.`);
})
.catch(error => {
console.log(error);
})
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
client.sendernames.list()
.then(sendernames => {
console.log(`There are ${sendernames.count} sendernames.`);
for(let sendername of sendernames.results) {
console.log(sendername)
}
})
.catch(error => {
console.log(error);
})
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
// List of all contacts
client.contacts.list()
.then(contacts => {
console.log(`There are ${contacts.results.length} contacts.`);
for(let contact of contacts.results) {
console.log(contact);
}
})
.catch(error => {
console.log(error);
})
// This contact will be added to the default contact list
const body = {
numero: '224XXXXXXXXX'
}
client.contacts.create(body)
.then(contact => {
console.log(`A contact has been added : `, contact);
})
.catch(error => {
console.log(error);
});
// Create with groups and name - name and groups are optional.
const body = {
numero: '224XXXXXXXXX',
name: 'Foo',
groups: ['API', 'Facebook Client'],
}
client.contacts.create(body)
.then(contact => {
console.log(`A contact has been added :`, contact);
})
.catch(error => {
console.log(error);
});
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
// Get All messages
client.messages.list()
.then(messages => {
console.log(`There are ${messages.count} messages in your account.`);
})
.catch(error => {
console.log(error);
});
// Get only 10 last messages
client.messages.list({limit: 10})
.then(messages => {
console.log('Here are the last 10 messages in your account:')
for( message of messages.results){
console.log(message)
}
})
.catch(error => {
console.log(error);
});
// Send a message
const body = {
to: ['6XXXXXXXXX'], // The recepients
message: 'Hello from Nimba SMS !',
sender_name: 'YYYYYYYYYY', // Replace with your sender name
}
client.messages.create(body)
.then(message => {
console.log(`A new message has been sent : `, message);
})
.catch(error => {
console.log(error);
});
// Retrieve a message's details
const messageId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
client.messages.get(messageId)
.then(message => {
console.log('Got one message : ', message)
})
.catch(error => {
console.log(error);
});
const { Client } = require('nimbasms/client');
const config = {
SERVICE_ID = 'XXXXXXXXXXX',
SECRET_TOKEN = 'YYYYYYYYYYYYYYYYYYY',
}
const client = new Client(config)
// Send a verification request
const verification = {
to: "+123456789",
message: "Your verification code is: <1234>",
expiry_time: 5,
};
client.verifications.create(verification)
.then(response => {
console.log("A verification request is issued: ", response);
})
.catch(error => {
console.log(error);
});
// Verify a verification request
const verificationParams = {
verificationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
code: "YYYY",
};
client.verifications.verify(verificationParams)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
})
Nimba SMS
FAQs
A Node JS module for communicating with Nimba SMS API.
The npm package nimbasms receives a total of 0 weekly downloads. As such, nimbasms popularity was classified as not popular.
We found that nimbasms 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.