Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@segment/analytics.js-integration-appboy

Package Overview
Dependencies
Maintainers
45
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/analytics.js-integration-appboy - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

5

HISTORY.md

@@ -0,1 +1,6 @@

1.4.0 / 2017-07-19
==================
* Add ability to add a custom API endpoint
1.3.0 / 2017-07-05

@@ -2,0 +7,0 @@ ==================

13

lib/index.js

@@ -52,3 +52,11 @@ 'use strict';

if (options.enableHtmlInAppMessages) config.enableHtmlInAppMessages = true;
if (options.datacenter === 'eu') config.baseUrl = 'https://sdk.api.appboy.eu/api/v3';
// Setup custom endpoints
if (options.customEndpoint) {
config.baseUrl = options.customEndpoint;
} else if (options.datacenter === 'eu') {
config.baseUrl = 'https://sdk.api.appboy.eu/api/v3';
}
self.initializeTester(options.apiKey, config);
window.appboy.initialize(options.apiKey, config);

@@ -64,2 +72,5 @@

// This is used to test window.appboy.initialize
Appboy.prototype.initializeTester = function() {};
/**

@@ -66,0 +77,0 @@ * Loaded?

3

package.json
{
"name": "@segment/analytics.js-integration-appboy",
"description": "The Appboy analytics.js integration.",
"version": "1.3.0",
"version": "1.4.0",
"keywords": [

@@ -55,4 +55,5 @@ "analytics.js",

"phantomjs-prebuilt": "^2.1.7",
"sinon": "^2.3.8",
"watchify": "^3.7.0"
}
}

@@ -9,2 +9,3 @@ 'use strict';

var assert = require('assert');
var sinon = require('sinon');

@@ -69,2 +70,30 @@ describe('Appboy', function() {

it('should set the sdk endpoint to EU datacenter if options.datacenter === eu', function(done) {
appboy.options.datacenter = 'eu';
var spy = sinon.spy(appboy, 'initializeTester');
analytics.once('ready', function() {
try {
assert.equal(spy.args[0][1].baseUrl, 'https://sdk.api.appboy.eu/api/v3');
done();
} catch (e) {
done(e);
}
});
analytics.initialize();
});
it('should set the sdk endpoint to a custom URI if one is provided', function(done) {
appboy.options.customEndpoint = 'https://my.custom.endpoint.com';
var spy = sinon.spy(appboy, 'initializeTester');
analytics.once('ready', function() {
try {
assert.equal(spy.args[0][1].baseUrl, 'https://my.custom.endpoint.com');
done();
} catch (e) {
done(e);
}
});
analytics.initialize();
});
it('should call changeUser if userID is present', function(done) {

@@ -71,0 +100,0 @@ analytics.user().id('user-id');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc