New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

phone-sms-gateway

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone-sms-gateway

Twilio alternative: turn your Android phone into a free SMS gateway. Send SMS, OTPs, and verification codes from any CLI, script, or backend without Twilio, Vonage, MessageBird, or Plivo. No per-message fees, no markups, no A2P 10DLC. Free 5-day trial at

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
36
-82.61%
Maintainers
1
Weekly downloads
 
Created
Source

phone-sms-gateway — turn your Android phone into a free SMS gateway

npm version npm downloads Node 18+ License: MIT

A phone SMS gateway in your terminal. Send SMS, generate and verify OTP codes, read your inbox — all routed through your own Android phone instead of paying Twilio, Vonage, MessageBird, or Plivo.

npx phone-sms-gateway send +14155550100 "Hello from my phone"

The message leaves your real mobile number and arrives in the recipient's regular SMS app. No CPaaS account. No per-SMS fees. No A2P 10DLC paperwork.

Why a phone SMS gateway?

CPaaS providers charge $0.0075 to $0.04 per SMS in the US, force you through A2P 10DLC registration, and route messages from short codes recipients don't recognise. Reply rates collapse.

A phone-based SMS gateway routes through the Android phone you already own. Messages arrive from your real local number. Recipients reply directly to you. And the cost is $29/month flat for unlimited SMS through one device.

This package gives you a CLI for that flow.

Install

# One-off
npx phone-sms-gateway send +14155550100 "Hi"

# Or install globally
npm install -g phone-sms-gateway
phone-sms-gateway send +14155550100 "Hi"
# alias also installed:
sms-gateway send +14155550100 "Hi"

Node 18 or newer.

Quick start

  • Sign up free at sms8.io (5-day trial, no card)
  • Install the SMS8 Android app on any Android phone, pair it with your account
  • Grab your API key from app.sms8.io/api.php
  • Set the key once:
    export SMS8_API_KEY=sk_xxx
    
  • Send your first SMS:
    phone-sms-gateway send +14155550100 "It works!"
    

Commands

# SMS
phone-sms-gateway send <phone> "<message>"

# OTP / 2FA
phone-sms-gateway otp send <phone>
phone-sms-gateway otp verify <phone> <code>
phone-sms-gateway otp wait <sender-phone> [--timeout=120]

# Inbox
phone-sms-gateway inbox [--limit=25] [--received] [--sent] [--phone=+14155550100]

# Devices
phone-sms-gateway devices

# Account
phone-sms-gateway balance
phone-sms-gateway setup

Device / SIM routing

Pick which paired Android phone (and which SIM on multi-SIM phones) sends each message:

phone-sms-gateway send +14155550100 "Hi" --device-id=10700 --sim-slot=2
phone-sms-gateway send +14155550100 "Hi" --devices=10700,10701|0
phone-sms-gateway send +14155550100 "Broadcast" --option=1     # all devices
phone-sms-gateway send +14155550100 "Broadcast" --option=2     # all SIMs across all devices
phone-sms-gateway send +14155550100 "Hi" --random-device       # load-balance

The same flags work on otp send and otp wait. Run phone-sms-gateway devices to list IDs.

OTP send options

phone-sms-gateway otp send +14155550100 --length=8 --expires-in=180
phone-sms-gateway otp send +14155550100 --template="Your YourApp code: {code}"

OTP verify

otp verify checks the most-recent unverified code for the phone. No device routing needed (the code lives server-side).

phone-sms-gateway otp verify +14155550100 482937

OTP wait

otp wait watches incoming SMS on a paired Android and extracts the verification code. Pass the sender's phone or partial match:

CODE=$(phone-sms-gateway otp wait +Google --contains="Google" --timeout=180)

Example: send notifications from a cron job

# /etc/cron.hourly/server-watchdog
LOAD=$(uptime | awk -F'load average:' '{print $2}')
phone-sms-gateway send +14155550100 "Server load: $LOAD" --api-key=$SMS8_API_KEY

Example: OTP loop in CI

# Trigger your app's OTP send
curl -X POST https://staging.app.com/otp -d 'phone=+14155550100'

# Block until the SMS arrives on the test SIM
CODE=$(phone-sms-gateway otp wait +14155550100 --timeout=180)

# Hand it back to the app
curl -X POST https://staging.app.com/verify -d "code=$CODE"

What's under the hood

This package shares its codebase with sms8-cli and connects to the SMS8 SMS-gateway platform. Pick whichever package name reads better in your toolchain — they expose the same bin/sms8.js.

For an AI / MCP integration (Claude Code, Cursor, Windsurf), see sms8-mcp.

License

MIT

Keywords

phone-sms-gateway

FAQs

Package last updated on 19 Sep 2026

Related posts