sms8-sdk
v1.0.0
Published
SMS8 SDK — send SMS, MMS, and OTPs from any Node/browser/Deno/Bun runtime through your own Android phone. Twilio alternative for developers. Includes CLI (sms8), React hooks + <OtpInput> component (sms8/react), and an MCP stdio bridge (sms8 mcp). No per-m
Maintainers
Readme
sms8
Twilio alternative for developers. Send SMS, MMS, OTPs, and verification codes from your own Android phone. No per-message fees. No A2P 10DLC. No markups. Free 5-day trial at sms8.io.
One package, every runtime — Node, browser, Deno, Bun, Cloudflare Workers, React, Next.js server actions, CLI, and MCP.
npm install sms8-sdkGet your free API key at https://app.sms8.io → Profile → API.
Runtime SDK (Node / edge / browser)
import { Sms8 } from 'sms8-sdk';
const sms8 = new Sms8({ apiKey: process.env.SMS8_API_KEY });
// Plain SMS
await sms8.sendSMS({ phone: '+14155550100', message: 'Order shipped' });
// MMS with an attachment
await sms8.sendSMS({
phone: '+14155550100',
message: 'Here is your receipt',
attachments: ['https://cdn.example.com/receipt.pdf'],
});
// OTP send + verify
const { otpId } = await sms8.sendOTP({ phone: '+14155550100' });
const { verified } = await sms8.verifyOTP({ phone: '+14155550100', code: '482937' });
// Routing controls (multi-device / multi-SIM)
await sms8.sendSMS({
phone: '+14155550100',
message: 'Hi',
deviceId: 182,
simSlot: '1',
prioritize: true,
});Full options: deviceId, simSlot, devices (explicit list), option (0=device / 1=broadcast-devices / 2=broadcast-sims), randomDevice, attachments, prioritize.
React
Opt-in subpath — nothing gets bundled unless you import from sms8/react.
import { useSms8Otp, OtpInput, OtpForm } from 'sms8-sdk/react';
function Login() {
const { send, verify, status } = useSms8Otp({ apiKey: 'sk_xxx' });
// ...
}Or the drop-in form:
<OtpForm apiKey="sk_xxx" phone="+14155550100" onVerified={goToDashboard} />Production: never embed the API key in a client bundle. Proxy through your backend and pass a short-lived token.
CLI
export SMS8_API_KEY=sk_xxx
sms8 send +14155550100 "Hi there"
sms8 send +14155550100 "Receipt attached" --attachment=https://cdn.example.com/r.pdf
sms8 otp send +14155550100
sms8 otp verify +14155550100 482937
sms8 inbox --since=1h
sms8 devices
sms8 balanceAdd --device-id=N, --sim-slot=S, --option=0|1|2, --random-device, or --prioritize on any send command.
MCP (for Claude / Cursor / Windsurf)
sms8 also ships a stdio MCP bridge:
// .mcp.json
{
"mcpServers": {
"sms8": {
"command": "npx",
"args": ["-y", "sms8-sdk", "mcp"],
"env": { "SMS8_API_KEY": "sk_xxx" }
}
}
}Or use the hosted HTTPS MCP at https://mcp.sms8.io directly.
Migrating from older packages
If you were using any of these, install sms8-sdk instead — the API is compatible and they now redirect to it:
sms8-cli,phone-sms-gateway,send-sms-from-android,sms-otp-using-myphonesms-otp-verify,react-sms-otpsms8-mcpcapacitor-sms-otp-send-verify,cordova-plugin-sms-otp-send(native mobile plugins remain separate)
License
MIT
