AbsoluteJS

@absolutejs/dispatch-sinch

@absolutejs/dispatch-sinchv0.3.0betaMessaging

Production Sinch Conversation API adapter for AbsoluteJS with multichannel fallback, signed durable webhooks, consent, readiness, and 10DLC workflows.

#Installation

BASH
bun add @absolutejs/dispatch-sinch

#Capabilities

Overview

Production Sinch Conversation API messaging for @absolutejs/dispatch.

What it covers

SMS, MMS, RCS, WhatsApp, Viber Business, Messenger, Instagram, Telegram,

KakaoTalk, LINE, and WeChat through the recommended Conversation API

Ordered channel_priority_order fallback with one generic message safely

Show 10 more

transcoded by Sinch

Text, one-media, omnichannel template, portable card/action, and guarded

extensions.sinch content

Atomic provider/project/tenant-scoped idempotency and indeterminate-outcome

handling through @absolutejs/reliability

HmacSHA256 verification over the exact raw callback body, nonce, and

timestamp, with replay bounds and one-secret rotation

Fast durable webhook intake followed by an out-of-band recovery drain,

stable provider-retry deduplication, delivery/inbound/choice event normalization, provider opt events, WhatsApp marketing preferences, and explicit SMS STOP/START/HELP parsing

Live app/channel/webhook readiness, asynchronous channel capability lookup,

Minimal sending

Use a durable idempotency store for every retryable production send and a durable webhook inbox for callbacks. createSinchWebhookHandler requires a trusted route-to-account resolver so the correct secret is selected before the raw body is parsed. Configure that URL as a registered Conversation API webhook in Sinch; the adapter intentionally does not emit a per-message callback_url, because override callbacks use a separate signing-secret contract.

The HTTP handler authenticates and durably stores each callback, then returns 202 without waiting for application code. Run drainSinchWebhookInbox() in a worker with the same durable inbox, consent ledger, scope resolver, and event handler. Consent writes and application effects share the same retry path, so a temporary ledger failure cannot complete a STOP event prematurely.

Compliance boundary

createSinchRegistrationClient() uses short-lived OAuth credentials against Sinch's US Registration API and Numbers API. Pass it to createSinchRegistrationManager() to submit and inspect 10DLC brands and campaigns, qualify use cases, preserve the number's SMS service plan while linking an approved campaign, and submit toll-free verification evidence.

These are operational workflows, not legal certification. Your application remains responsible for consent evidence, privacy/terms, quiet hours, opt-out testing, and carrier-specific program rules.

Outcomes

What you can build

Build on the supported package contract

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

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/dispatch-sinch 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-sinch example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Minimal sending

Partial snippet

Working example for Minimal sending.

TS
import { createDispatcher } from "@absolutejs/dispatch";
import { createSinchAdapter } from "@absolutejs/dispatch-sinch";
import { SinchClient } from "@sinch/sdk-core";

const client = new SinchClient({
  conversationRegion: "us",
  keyId: process.env.SINCH_KEY_ID!,
  keySecret: process.env.SINCH_KEY_SECRET!,
  projectId: process.env.SINCH_PROJECT_ID!,
});

const messaging = createSinchAdapter({
  appId: process.env.SINCH_APP_ID!,
  client,
  projectId: process.env.SINCH_PROJECT_ID!,
});

const dispatch = createDispatcher({ messaging });
await dispatch.messaging({
  content: { kind: "text", text: "Production latency is elevated." },
  fallbacks: [{ transport: "sms" }],
  idempotencyKey: "incident-42:recipient-7",
  to: { address: "+12025550100", transport: "rcs" },
});

#Compliance boundary

Partial snippet

createSinchRegistrationClient() uses short-lived OAuth credentials against Sinch's US Registration API and Numbers API. Pass it to createSinchRegistrationManager() to submit and inspect 10DLC brands and campaigns, qualify use cases, preserve the number's SMS service plan while linking an approved campaign, and submit toll-free verification evidence.

TS
import {
  createSinchRegistrationClient,
  createSinchRegistrationManager,
} from "@absolutejs/dispatch-sinch";

const registrations = createSinchRegistrationManager(
  createSinchRegistrationClient({
    keyId: process.env.SINCH_KEY_ID!,
    keySecret: process.env.SINCH_KEY_SECRET!,
  }),
  process.env.SINCH_PROJECT_ID!,
);

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/dispatch-sinch@absolutejs/dispatch-sinch/manifest@absolutejs/dispatch-sinch/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 @sinch/sdk-core --external '@sinch/*' && 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.

53 symbols
createSinchAdapterexportPermalinkSource
TS
createSinchAdapter
Exported from @absolutejs/dispatch-sinch