A lightweight, dependency-free Twilio API client providing typed helpers for managing phone number webhooks and authentication headers.
// Source: https://github.com/vellum-ai/vellum-assistant | License: MIT | Copyright 2025 Vellum AI
// Provided via justclaw.it.com; keep this notice with the code.
export type TwilioFetch = (
input: string | URL | Request,
init?: RequestInit,
) => Promise<Response>;
export interface TwilioCredentials {
accountSid: string;
authToken: string;
}
export interface TwilioRequestOptions {
fetchImpl?: TwilioFetch;
signal?: AbortSignal;
timeoutMs?: number;
}
export interface TwilioWebhookUrls {
voiceUrl: string;
statusCallbackUrl: string;
}
export interface TwilioRestErrorOptions {
cause?: unknown;
status?: number;
}
export class TwilioRestError extends Error {
readonly provider = "twilio";
readonly status?: number;
constructor(message: string, options: TwilioRestE
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key