AbsoluteJS

@absolutejs/dispatch-telnyx

@absolutejs/dispatch-telnyxv0.3.0betaMessaging

Production Telnyx SMS, MMS, and RCS messaging for @absolutejs/dispatch with signed webhooks, consent-safe scheduling, registration workflows, and readiness checks.

#Installation

BASH
bun add @absolutejs/dispatch-telnyx

#Capabilities

Overview

Production Telnyx SMS, MMS, and direct rich RCS for @absolutejs/dispatch. The package includes multi-account routing, atomic idempotency, Ed25519-signed webhook processing, durable inbox recovery, consent ingestion, scheduling cancellation, RCS capability checks, carrier registration helpers, and readiness diagnostics.

Send SMS, MMS, and RCS

RCS can use portable rich cards and an explicit fallback route. The compliance policy derives both rcs and sms consent checks from these routes:

Use checkTelnyxRcsCapabilities() when product behavior should differ before sending. Telnyx still performs delivery fallback when one is declared.

Reliability and webhooks

Apply IDEMPOTENT_OPERATION_POSTGRES_SCHEMA and WEBHOOK_INBOX_POSTGRES_SCHEMA, then use a checked-out transaction runner. Idempotency is scoped by provider, organization, tenant, namespace, and key; payload reuse conflicts, fencing prevents stale completion, and ambiguous provider calls become indeterminate instead of being retried automatically.

resolveAccount() returns one or two active Ed25519 public keys for safe key rotation and an optional Messaging Profile allowlist. Verification covers the raw body and timestamp before parsing or processing. Events are normalized with provider event id, occurrence time, typed endpoints and content, normalized interaction, provider status, transport, and delivery errors. Completed inbox rows default to a 24-hour purge window when the processor runs; applications should also run a scheduled purge and their legal-hold policy.

Scheduling, registration, and readiness

Native scheduling is opt-in, limited to SMS/MMS from five minutes to five days, and prohibited for consent-scoped messages. Prefer an Absolute queue that re-evaluates consent immediately before delivery. Use createTelnyxScheduledMessageManager() to inspect or cancel native schedules.

createTelnyxComplianceManager() validates privacy/terms, opt-in evidence, current business-registration fields, and exposes explicit a2p and toll-free inspections with rejection diagnostics. It does not certify legal compliance. inspectTelnyxMessagingReadiness() checks the live Messaging Profile/webhook binding plus operator assertions for consent, durable storage, opt-out testing, carrier registration, and RCS approval.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/dispatch-telnyx through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/dispatch-telnyx version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/dispatch-telnyx example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Send SMS, MMS, and RCS

Partial snippet

Working example for Send SMS, MMS, and RCS.

TS
import { createDispatcher } from "@absolutejs/dispatch";
import {
  createPostgresIdempotentOperationStore,
  createPostgresTransactionRunner,
  createTelnyxAdapter,
} from "@absolutejs/dispatch-telnyx";
import { Telnyx } from "telnyx";

const client = new Telnyx({ apiKey: process.env.TELNYX_API_KEY! });
const runner = createPostgresTransactionRunner(postgresPool);

const dispatcher = createDispatcher({
  messaging: createTelnyxAdapter({
    accountId: process.env.TELNYX_ORGANIZATION_ID!,
    client,
    idempotencyStore: createPostgresIdempotentOperationStore(runner),
    messagingProfileId: process.env.TELNYX_MESSAGING_PROFILE_ID!,
    rcsAgentId: process.env.TELNYX_RCS_AGENT_ID,
    webhookFailoverUrl: "https://failover.example.com/webhooks/telnyx",
    webhookUrl: "https://app.example.com/webhooks/telnyx",
  }),
});

await dispatcher.messaging({
  content: { kind: "text", text: "Production database latency is elevated." },
  consent: { programId: "pro-alerts", purpose: "incident-alerts" },
  idempotencyKey: "incident-42:recipient-7",
  tenant: "tenant-a",
  to: { address: "+12025550100", transport: "sms" },
});

#Send SMS, MMS, and RCS 2

Partial snippet

RCS can use portable rich cards and an explicit fallback route. The compliance policy derives both rcs and sms consent checks from these routes:

TS
await dispatcher.messaging({
  content: {
    actions: [
      {
        kind: "url",
        label: "Open incident",
        url: "https://app.example.com/incidents/42",
      },
    ],
    kind: "rich",
    mediaUrl: "https://cdn.example.com/incident.png",
    text: "Production database latency is elevated.",
    title: "Incident 42",
  },
  consent: { programId: "pro-alerts", purpose: "incident-alerts" },
  fallbacks: [
    {
      content: {
        kind: "text",
        text: "Incident 42: https://app.example.com/incidents/42",
      },
      from: { address: "+12025550199", transport: "sms" },
      transport: "sms",
    },
  ],
  to: { address: "+12025550100", transport: "rcs" },
});

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/dispatch-telnyx@absolutejs/dispatch-telnyx/manifest@absolutejs/dispatch-telnyx/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/compliance --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/reliability --external '@absolutejs/reliability/*' --external @absolutejs/manifest --external @sinclair/typebox --external telnyx --external 'telnyx/*' && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

48 symbols
checkTelnyxRcsCapabilitiesexportPermalinkSource
TS
checkTelnyxRcsCapabilities
Exported from @absolutejs/dispatch-telnyx