Skip to content

PhoneNumber

Source: src/AWS/PinpointSMSVoiceV2/PhoneNumber.ts

An AWS End User Messaging SMS (Pinpoint SMS Voice v2) origination phone number leased into your account.

Requesting a number incurs a monthly leasing fee and most number types require account-level entitlement (spending limits, registration). SIMULATOR numbers are the cheap, entitlement-free option for testing.

Simulator Number

import * as PinpointSMSVoiceV2 from "alchemy/AWS/PinpointSMSVoiceV2";
const number = yield* PinpointSMSVoiceV2.PhoneNumber("TestNumber", {
isoCountryCode: "US",
messageType: "TRANSACTIONAL",
numberCapabilities: ["SMS"],
numberType: "SIMULATOR",
});

Toll-Free Number with a Custom Opt-Out List

const optOuts = yield* PinpointSMSVoiceV2.OptOutList("OptOuts");
const number = yield* PinpointSMSVoiceV2.PhoneNumber("Sender", {
isoCountryCode: "US",
messageType: "TRANSACTIONAL",
numberCapabilities: ["SMS", "VOICE"],
numberType: "TOLL_FREE",
optOutListName: optOuts.optOutListName,
});