MVFM

twilio

Implementation of the Twilio REST API. There is no default interpreter because this plugin requires account credentials.

The documented node kinds currently cover message and call operations with deterministic mocked execution in the playground.

import { twilio, wrapTwilioSdk, createTwilioInterpreter } from "@mvfm/plugin-twilio";
import twilioSdk from "twilio";

// 1. Create a Twilio SDK client
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const sdk = twilioSdk(accountSid, process.env.TWILIO_AUTH_TOKEN);
const client = wrapTwilioSdk(sdk);

// 2. Build the interpreter (requires accountSid for API paths)
const twilioInterp = createTwilioInterpreter(client, accountSid);

// 3. Merge and run
const app = mvfm(prelude, twilio);
const baseInterp = defaults(app);
await fold(
  { ...baseInterp, ...twilioInterp },
  prog
);