sendSms (destinations/twilio.ts)

dittofeed · packages/backend-lib/src/destinations/twilio.ts · typescript · MIT
voice, Voice / Speech

Functions to send SMS via Twilio and process webhook events into analytics.

// Source: https://github.com/dittofeed/dittofeed | License: MIT | Copyright [2023] [Idea Market inc.]
// Provided via justclaw.it.com; keep this notice with the code.
import { SourceType } from "isomorphic-lib/src/constants";
import { err, ok, Result, ResultAsync } from "neverthrow";
import qs from "querystring";
import { omitBy } from "remeda";
import TwilioClient from "twilio";
import RestException from "twilio/lib/base/RestException";
import { v5 as uuidv5 } from "uuid";

import { submitBatch } from "../apps/batch";
import config from "../config";
import logger from "../logger";
import {
  BatchTrackData,
  EventType,
  InternalEventType,
  MessageTags,
  SmsProviderType,
  TwilioInboundSchema,
  TwilioMessageStatus,
  TwilioWebhookRequest,
} from "../types";

export const TwilioRestEx

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key