messagebird
Advanced tools
Comparing version 3.6.0 to 3.6.1
var messagebird = require('messagebird')('<YOUR_ACCESS_KEY>'); | ||
messagebird.hlr.create('31612345678', 'MessageBird', function (err, response) { | ||
messagebird.hlr.create('31612345678', 'YourBrand', function (err, response) { | ||
if (err) { | ||
@@ -6,0 +6,0 @@ return console.log(err); |
@@ -5,3 +5,3 @@ | ||
var params = { | ||
'originator': 'MessageBird', | ||
'originator': 'YourBrand', | ||
'recipients': [ | ||
@@ -8,0 +8,0 @@ '31612345678' |
@@ -29,5 +29,11 @@ /** | ||
var VOICE_ENDPOINT = 'voice.messagebird.com'; | ||
var IS_FIREBASE_PLUGIN_ENABLED = false; | ||
if (features && 'indexOf' in features && features.indexOf('ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX') !== -1) { | ||
CONVERSATIONSENDPOINT = "whatsapp-sandbox.messagebird.com"; | ||
if (features && 'indexOf' in features) { | ||
if (features.indexOf('ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX') !== -1) { | ||
CONVERSATIONSENDPOINT = "whatsapp-sandbox.messagebird.com"; | ||
} | ||
if (features.indexOf('ENABLE_FIREBASE_PLUGIN') !== -1) { | ||
IS_FIREBASE_PLUGIN_ENABLED = true; | ||
} | ||
} | ||
@@ -74,2 +80,9 @@ | ||
function getUserAgent() { | ||
if (IS_FIREBASE_PLUGIN_ENABLED) { | ||
return 'MessageBird/ApiClient/FirebasePlugin'; | ||
} | ||
return 'MessageBird/ApiClient/' + pkg.version + ' Node.js/' + process.versions.node; | ||
} | ||
// build request | ||
@@ -82,3 +95,3 @@ options = { | ||
'Authorization': 'AccessKey ' + config.accessKey, | ||
'User-Agent': 'MessageBird/ApiClient/' + pkg.version + ' Node.js/' + process.versions.node | ||
'User-Agent': getUserAgent(), | ||
} | ||
@@ -85,0 +98,0 @@ }; |
{ | ||
"name": "messagebird", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "A node.js wrapper for the MessageBird REST API", | ||
@@ -34,10 +34,10 @@ "main": "lib/messagebird.js", | ||
"dependencies": { | ||
"safe-buffer": "^5.1.2", | ||
"scmp": "^2.0.0" | ||
"safe-buffer": "^5.2.1", | ||
"scmp": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"dtslint": "^4.0.7", | ||
"dtslint": "^4.0.9", | ||
"nock": "^11.3.2", | ||
"typescript": "^4.2.2" | ||
"typescript": "^4.2.4" | ||
} | ||
} |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export type Features = "ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX"; | ||
export type Features = "ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX" | "ENABLE_FIREBASE_PLUGIN"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186559
5689
Updatedsafe-buffer@^5.2.1
Updatedscmp@^2.1.0