better-smpp
Client

Overview

SmppClient — the fully-typed SMPP ESME.

SmppClient from @better-smpp/client is the ESME side of SMPP: it connects to an SMSC, binds, submits messages and receives deliveries. Every operation is Promise-based; every unsolicited PDU arrives through a typed event.

import { SmppClient } from "@better-smpp/client";

const client = new SmppClient({
  url: "smpp://systemId:password@smsc.example.com:2775",
});
await client.connect();
await client.bindTransceiver();

Options

OptionDefaultDescription
urlsmpp://[systemId:password@]host[:port], or ssmpp:// for TLS
host / portlocalhost / 2775 (3550 TLS)Discrete target; overrides URL parts
tlsofftrue or node:tls connect options. Certificates verified by default
connectTimeoutMs30000TCP/TLS connect timeout
requestTimeoutMs30000Default response timeout per request
enquireLinkoffKeepalive: interval ms, or { intervalMs, timeoutMs, maxMissed }
windowSizeunlimitedMax outstanding un-acked requests; overflow queues FIFO
windowQueueLimitunlimitedQueue length beyond the window before failing fast
concatenation{ method: "udh" }Long-message auto-split; { method: "sar" } or false
throttleonBackoff retry on ESME_RTHROTTLED / ESME_RMSGQFUL; false disables
reconnectofftrue or { maxRetries, baseDelayMs, maxDelayMs, rebind }
autoAckDeliverSmtrueAnswer deliver_sm automatically after events fire
systemId, password, systemType, interfaceVersion, addrTon, addrNpi, addressRangeBind defaults
registrystandardSmppRegistry with custom commands/TLVs
defaultEncoding"ASCII"Text encoding used for dataCoding 0
maxPduLength16384Upper bound on accepted/produced PDU size
logger / metricsno-opObservability hooks

Operations

MethodReturns
connect()resolves when the transport is ready
bindTransmitter/bindReceiver/bindTransceiver(params?)the bind response
submitSm(params)SubmitResult (auto-split aware)
dataSm(params)data_sm_resp
querySm(params)query_sm_resp
cancelSm(params) / replaceSm(params)void
respond(pdu, fields?)sends the matching _resp
unbind()performs the unbind handshake
close() / destroy()graceful / immediate teardown

All request operations take { timeoutMs, signal } as an optional second argument.

Events

EventPayloadWhen
connecttransport established (before bind)
boundSessionStatea bind completed
unboundunbind handshake done
messageAssembledMessagecomplete inbound message (multipart already joined)
receiptDeliveryReceipt, pduparsed delivery receipt
deliver_smdecoded PDUevery raw deliver_sm
alert_notification / outbinddecoded PDUSMSC-initiated PDUs
throttledstatus, delayMsa submit hit throttling; retrying
congestion0–100SMSC reported congestionState
reconnecting / reconnectedattempt info / —reconnect lifecycle
pdu / unknownPdudecoded PDUobservability firehose
error / closeError / —transport lifecycle

On this page