import * as twilio from 'twilio' ; export class SmsService { private provider = process . env . NODE_ENV === 'test' ? null : twilio ( this . SID , this . AUTH_TOKEN ) ; constructor ( private AUTH_TOKEN , private SID ) { } async sendMessage ( to , from , body ) { if ( process . env . NODE_ENV === 'test' ) { return null ; } return await this . provider . messages . create ( { body , to , from , } ) ; } }