@webillium/ralink-sms-gateway-cli
v0.1.0
Published
CLI for the Ralink SMS Gateway Android app over IROH.
Readme
@webillium/ralink-sms-gateway-cli
Node.js CLI and library for communicating with the Ralink SMS Gateway Android app over IROH.
Install
npm install @webillium/ralink-sms-gateway-cliCLI
ralink-sms status \
--gateway-id <gateway-id> \
--secret <api-secret> \
--ticket <current-ticket>ralink-sms send \
--gateway-id <gateway-id> \
--secret <api-secret> \
--ticket <current-ticket> \
--to +381641234567 \
--text "Hello"ralink-sms inbox \
--gateway-id <gateway-id> \
--secret <api-secret> \
--ticket <current-ticket> \
--limit 20Node API
import { createRalinkSmsClient } from '@webillium/ralink-sms-gateway-cli';
const gateway = createRalinkSmsClient({
gatewayId: process.env.RALINK_GATEWAY_ID,
secret: process.env.RALINK_API_SECRET,
ticket: process.env.RALINK_GATEWAY_TICKET,
timeoutMs: 15000,
});
const online = await gateway.isOnline();
const presence = await gateway.presence();
if (!online) {
throw new Error('SMS gateway is offline');
}
const result = await gateway.sendSms({
to: '+381641234567',
text: 'Message from Node.js',
});
console.log(presence, result);The Android app shows the required Gateway ID, API secret, and current IROH ticket.
