Skip to content

Commit

Permalink
add support for API KEY auth, per twilio/twilio-node#600 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
camschaus committed Feb 25, 2021
1 parent 3c64f74 commit 334a521
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/twilio.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ function TwilioConnector(settings) {
var accountSid = this.accountSid = settings.accountSid;
var authToken = this.authToken = settings.authToken;
var sgAPIKey = this.sgAPIKey = settings.sgAPIKey;
var accountSidProper = this.accountSidProper = settings.accountSidProper;
var options = {};
if (accountSidProper) { options.accountSid = accountSidProper; }

twilio = connector.twilio = require('twilio')(accountSid, authToken);
twilio = connector.twilio = require('twilio')(accountSid, authToken, options);
sgMail = connector.sgMail = require('@sendgrid/mail');
sgMail.setApiKey(sgAPIKey);
}
Expand Down

0 comments on commit 334a521

Please sign in to comment.