Introduction
A modern, fully-typed TypeScript implementation of the SMPP protocol for Node.js.
better-smpp is a ground-up rewrite of the classic
node-smpp library: byte-compatible on the wire,
redesigned above it. It implements SMPP v3.3, v3.4 and v5.0 — including the complete
v5.0 broadcast command family — for Node.js ≥ 20.
Why better-smpp?
- Typed end to end. Every PDU is a discriminated union keyed by
command;submitSmfields are typed differently frombindTransmitterfields. Events, options and errors are all fully typed — noanyin the public API. - Promise-based.
await client.submitSm(...)with per-request timeouts andAbortSignalsupport instead of positional callback triples. - Byte-compatible. The PDU codec is verified against the original
node-smppimplementation with an oracle test suite asserting byte-identical encoding for every command, including GSM 03.38 national-language shift tables. - Built for production. The features the original never had: automatic long-message concatenation, structured delivery receipts, send windows with backpressure, throttle-aware retries, dead-link detection, and automatic reconnect + rebind.
- Zero runtime dependencies in
@better-smpp/core; the client and server packages depend only on core. Dual ESM + CJS builds with full.d.ts.
Packages
| Package | Purpose |
|---|---|
@better-smpp/client | SmppClient (ESME): connect, bind, submit, receive |
@better-smpp/server | SmppServer (SMSC side): accept, authenticate, deliver |
@better-smpp/core | Protocol defs, PDU codec, encodings, message utilities, shared connection layer |
Most applications only install client and/or server — core comes along as a
dependency. Install core directly when you import its utilities yourself.
Installation
Add better-smpp to your project.
Quickstart
Send your first message in five minutes.
Client guide
Everything about SmppClient.
Server guide
Run your own SMSC-side endpoint.
A taste
import { SmppClient } from "@better-smpp/client";
const client = new SmppClient({
url: "smpp://systemId:password@smsc.example.com:2775",
enquireLink: 30_000,
reconnect: true,
});
await client.connect();
await client.bindTransceiver();
const result = await client.submitSm({
destinationAddr: "46709771337",
shortMessage: "Hello from better-smpp!",
registeredDelivery: 1,
});
client.on("receipt", (receipt) => {
console.log(receipt.messageId, receipt.state); // "abc123", "DELIVRD"
});