--- title: Hep.gg SMS JavaScript SDK (LLM) description: Send SMS, list inbound, verify webhooks from Node/TypeScript via the hepgg package. --- # Hep.gg SMS SDK (hepgg package) Typed Node/TypeScript client for https://sms.hep.gg. Subpath: `hepgg/sms`. Part of the unified `hepgg` package. Node 20+. ## Install npm install hepgg --registry https://npm.hep.gg ## Functional API (drop-in for the old `sms` package) import { send } from "hepgg/sms"; await send(token, recipient, content) -> SendResult token string SMS API key. recipient string E.164, e.g. +447700900000. content string 1-799 chars. ## Class API import { SMS } from "hepgg/sms"; const sms = new SMS({ token, baseURL?, timeoutMs?, retries?, fetch? }); sms.send(recipient, content) -> SendResult sms.list() -> InboundMessage[] newest first; [] when empty (404 mapped to []) sms.stats() -> object public stats, no auth SendResult fields: ID, sent_from, sent_to, sent_to_parsed { isValid, phoneNumber, countryIso2, countryIso3, countryCode }, content, owner, creditCost. InboundMessage fields: id, userID, sender, shortcode, content, webhook_status, created_at. Auth: token sent raw in the Authorization header (no "Bearer" prefix). ## Webhook helpers import { parseWebhook, verifyWebhook } from "hepgg/sms"; parseWebhook(body) -> { sender, auth, shortcode, messageContent } (throws TypeError on bad shape) verifyWebhook(body, expectedSecret) -> boolean (constant-time compare of body.auth) Inbound webhook body fields: sender, auth (the shared secret, in the body), shortcode, messageContent. ## Errors Non-2xx throws HepError { status, code, service: "sms", message, body }. `send` is never retried after a server response (no duplicate texts). ## Part of the hepgg package Also provides: hepgg/id, hepgg/email, hepgg/uploader, hepgg/paste, hepgg/secrets, hepgg/ai, hepgg/login, hepgg/logger (logger docs: https://docs.teamhydra.dev/docs/logger/getting-started). Full SMS reference: /llms/sms/sending, /llms/sms/receiving, /llms/sms/listing.