EnfinitOSEnfinitOS
DevelopersEnvironment
Production-ready scaffold

Messaging SDK

Twilio, WhatsApp, APNs, FCM, RCS. Every send pre-checks the OptOutRegistryConstraint — TCPA, PECR, DNC, CASL.

@enfinitos/sdk-messagingSubstrate MESSAGINGTypeScript
Install

Get the SDK

npm install @enfinitos/sdk-messaging

About this status badge

Typed, tested, documented, and grounded in the 2026 platform reality. Awaiting first customer-integration validation.

README

The developer-facing documentation in full

Rendered from packages/sdks/messaging/README.md at build time — the same source the package ships with.

@enfinitos/sdk-messaging

EnfinitOS reference SDK for the MESSAGING substrate. Built around the OptOutRegistryConstraint shipped earlier — every send goes through a pre-send TCPA / PECR / DNC / CASL check + a per- jurisdiction quiet-hours gate before reaching the carrier.

Architecture

                  ┌─────────────────────────────────────────┐
                  │   @enfinitos/sdk-renderer-core (TS)     │
                  │   resolve / event-ingest / health       │
                  │   OptOutRegistryConstraint              │
                  └─────────────────────────────────────────┘
                                     ▲
                                     │
                  ┌──────────────────┴──────────────────┐
                  │   messaging ts-core (OptOutChecker  │
                  │   + QuietHoursEnforcer +            │
                  │   sendWithGovernance)               │
                  └──────────────────┬──────────────────┘
                                     │
   ┌─────────────────┬─────────────┬─────────────┬─────────────┬─────────────┐
   │                 │             │             │             │             │
┌───────┐      ┌──────────┐  ┌────────┐    ┌────────┐    ┌────────┐   ┌────────┐
│Twilio │      │ WhatsApp │  │ APNs   │    │  FCM   │    │SendGrid│   │Mailgun │
│v5 SDK │      │ Business │  │ JWT/p8 │    │HTTP v1 │    │CAN-SPAM│   │email   │
│(SMS+  │      │ Cloud API│  │(certs  │    │(legacy │    │compl.  │   │        │
│RCS+   │      │(Cloud,   │  │deprec.)│    │HTTP    │    │        │   │        │
│Voice) │      │not       │  │        │    │deprec.)│    │        │   │        │
│       │      │On-Prem)  │  │        │    │        │    │        │   │        │
└───────┘      └──────────┘  └────────┘    └────────┘    └────────┘   └────────┘

Getting started

import { MessagingClient, MessageChannel } from "@enfinitos/sdk-messaging";

const messaging = new MessagingClient({
  apiBaseUrl: "https://api.enfinitos.com",
  authToken: jwt,
  orgId: "acme",
});
await messaging.start();

const r = await messaging.sendWithGovernance({
  channel: MessageChannel.SMS,
  recipient: { phoneE164: "+15555550100", jurisdiction: "US-CA" },
  body: "Your appointment is tomorrow at 9am.",
  campaignId: "campaign-123",
});
if (r.status === "delivered") {
  // ...
}
if (r.status === "blocked") {
  console.log("Blocked:", r.reason);
}

2026 platform notes

Twilio (v5)

  • Twilio Node SDK v5 (released 2024). Messaging v1 API + Programmable Voice v2. ConnectionService for delivery verification.
  • RCS Business Messaging is mainstream now (Apple added RCS support to iOS 18 in Sept 2024). The Twilio SDK targets RCS as the primary path for cross-platform rich messaging.

WhatsApp

  • WhatsApp Business Cloud API (Meta-hosted) only. The on-premises API is end-of-life as of Oct 2025; we do NOT target it for new integrations.
  • Template messages (Marketing, Utility, Authentication) use the Meta Business Manager-approved templates.

APNs

  • Token-based (JWT / .p8) authentication ONLY. Certificate-based authentication is deprecated for new apps. The SDK refuses to start with certificate-based credentials.

FCM

  • HTTP v1 API ONLY (fcm.googleapis.com/v1). The legacy HTTP API (fcm.googleapis.com/fcm/send) is end-of-life June 2024; the SDK does not use it.

RCS Business Messaging

  • Mainstream after Apple's iOS 18 RCS support (Sept 2024). The Twilio adapter exposes RCS as a first-class channel; the fallback ladder is RCS → SMS when the recipient's device doesn't support RCS.

Email

  • CAN-SPAM compliance is built into the SendGrid + Mailgun bridges — every send includes the operator's physical address + an unsubscribe link, and the SDK refuses to send if those are missing.

OptOutRegistry contract

Every sendWithGovernance call invokes:

  1. OptOutChecker — queries the platform's /opt-out-registry/check endpoint with (channel, recipient, campaignId, jurisdiction). Returns allowed | opted-out | unknown.
  2. QuietHoursEnforcer — per-jurisdiction quiet-hours rules (US: 8am-9pm local; PECR (UK/EU): per-marketer schedule; CASL (Canada): per-consent expiry).
  3. Send via the channel adapter (Twilio, WhatsApp, APNs, FCM, email).
  4. Report the delivery + the decision to the platform's audit log.

Endpoint surface

SDK callPlatform endpointStatus
sendWithGovernancePOST /opt-out-registry/check then channel APIexisting
reportDelivery/Read/ClickPOST /runtime/event-ingestexisting
OptOutRegistry syncPOST /opt-out-registry/syncexisting
Twilio status webhookOperator's webhook URL; forwarded by SDKexisting
APNs token rotationApple's JWT signingexisting (SDK-side)
API reference

Hit the HTTP surface directly

The Messaging SDK is a thin client over the same governed HTTP API every other SDK calls. The full OpenAPI 3.1 reference lives on the docs site.

Sandbox

Run this SDK against a real tenant

The hosted sandbox is the fastest way to verify Messaging SDK against a real EnfinitOS tenant before committing to a pilot. Launching Q4 2026.