better-smpp
Core

Overview

@better-smpp/core — the protocol layer everything else is built on.

@better-smpp/core contains everything protocol-level, with zero runtime dependencies:

AreaWhat's in it
PDUs & codecencodePdu / decodePdu / createResponse / isPdu, discriminated-union PDU types
DefinitionsCommandId, CommandStatus, tlvSpecs, TON, NPI, ESM_CLASS, DATA_CODING, MESSAGE_STATE, SessionState, …
EncodingsGSM 03.38 (+ Turkish/Spanish/Portuguese shift tables), Latin-1, UCS2, detection, 7-bit packing
Message utilitiessplitMessage, MessageReassembler, parseDeliveryReceipt
Connection layerSmppConnection — framing, correlation, windows, keepalive
Custom commandsSmppRegistry for vendor commands and TLVs
Errorsthe SmppError hierarchy

The client and server packages are thin, opinionated compositions of these pieces. Reach for core directly when you're building:

  • an SMPP proxy (decode, inspect, re-encode — unknown TLVs round-trip),
  • protocol tooling (traffic analyzers, test harnesses, fuzzers),
  • a custom role the client/server shapes don't fit.
pnpm add @better-smpp/core

Everything is exported from the package root as tree-shakeable named exports:

import {
  encodePdu, decodePdu, createResponse, isPdu,
  CommandStatus, TON, DATA_CODING,
  splitMessage, MessageReassembler, parseDeliveryReceipt,
  SmppConnection, SmppRegistry,
} from "@better-smpp/core";

Wire-compatibility guarantee

The codec is tested for byte-identical output against the original node-smpp implementation (vendored as a read-only oracle in the repository) across every command, the full TLV table, and every GSM 03.38 charset. If you're replacing a node-smpp deployment, the bytes on the wire do not change.

On this page