Core
Overview
@better-smpp/core — the protocol layer everything else is built on.
@better-smpp/core contains everything protocol-level, with zero runtime
dependencies:
| Area | What's in it |
|---|---|
| PDUs & codec | encodePdu / decodePdu / createResponse / isPdu, discriminated-union PDU types |
| Definitions | CommandId, CommandStatus, tlvSpecs, TON, NPI, ESM_CLASS, DATA_CODING, MESSAGE_STATE, SessionState, … |
| Encodings | GSM 03.38 (+ Turkish/Spanish/Portuguese shift tables), Latin-1, UCS2, detection, 7-bit packing |
| Message utilities | splitMessage, MessageReassembler, parseDeliveryReceipt |
| Connection layer | SmppConnection — framing, correlation, windows, keepalive |
| Custom commands | SmppRegistry for vendor commands and TLVs |
| Errors | the 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/coreEverything 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.