better-smpp

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; submitSm fields are typed differently from bindTransmitter fields. Events, options and errors are all fully typed — no any in the public API.
  • Promise-based. await client.submitSm(...) with per-request timeouts and AbortSignal support instead of positional callback triples.
  • Byte-compatible. The PDU codec is verified against the original node-smpp implementation 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

PackagePurpose
@better-smpp/clientSmppClient (ESME): connect, bind, submit, receive
@better-smpp/serverSmppServer (SMSC side): accept, authenticate, deliver
@better-smpp/coreProtocol 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.

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"
});

On this page