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

@segment/analytics.js-integration-segmentio

Package Overview
Dependencies
Maintainers
133
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.0-beta.5 to 0.0.0-beta.6

14

lib/index.js

@@ -320,2 +320,4 @@ 'use strict';

msg._metadata.unbundled = this.options.unbundledIntegrations;
msg._metadata.bundledConfigs = this.options.bundledConfigs;
msg._metadata.unbundledConfigs = this.options.unbundledConfigs;
}

@@ -474,10 +476,6 @@ this.debug('normalized %o', msg);

// Exclude the current domain from the list of servers we're querying
var currentTld = getTld(window.location.hostname);
var domains = [];
for (var i = 0; i < this.options.crossDomainIdServers.length; i++) {
var domain = this.options.crossDomainIdServers[i];
if (getTld(domain) !== currentTld) {
domains.push(domain);
}
domains.push(domain);
}

@@ -530,7 +528,3 @@

if (this.options.saveCrossDomainIdInLocalStorage) {
var id = localstorage('seg_xid');
if (id === null || id === undefined) {
return this.cookie('seg_xid');
}
return id;
return localstorage('seg_xid');
}

@@ -537,0 +531,0 @@ return this.cookie('seg_xid');

{
"name": "@segment/analytics.js-integration-segmentio",
"description": "The Segmentio analytics.js integration.",
"version": "0.0.0-beta.5",
"version": "0.0.0-beta.6",
"keywords": [

@@ -6,0 +6,0 @@ "analytics.js",

@@ -1120,22 +1120,2 @@ 'use strict';

describe('with ' + scenario, function() {
it('should generate xid locally if there is only one (current hostname) server', function() {
segment.options.crossDomainIdServers = ['localhost'];
segment.options.saveCrossDomainIdInLocalStorage =
cases[scenario];
var res = null;
segment.retrieveCrossDomainId(function(err, response) {
res = response;
});
var identify = segment.onidentify.args[0];
var crossDomainId = identify[0].traits().crossDomainId;
analytics.assert(crossDomainId);
analytics.assert(res.crossDomainId === crossDomainId);
analytics.assert(res.fromDomain === 'localhost');
assert.equal(segment.getCachedCrossDomainId(), crossDomainId);
});
it('should obtain crossDomainId', function() {

@@ -1198,2 +1178,11 @@ server.respondWith(

);
server.respondWith(
'GET',
'https://localhost/v1/id/' + segment.options.apiKey,
[
200,
{ 'Content-Type': 'application/json' },
'{ "id": null }'
]
);
if (segment.options.saveCrossDomainIdInLocalStorage) {

@@ -1242,2 +1231,7 @@ server.respondWith('GET', /https:\/\/localhost\/v1\/saveId/, [

);
server.respondWith(
'GET',
'https://localhost/v1/id/' + segment.options.apiKey,
[500, { 'Content-Type': 'application/json' }, '']
);
server.respond();

@@ -1248,3 +1242,3 @@

analytics.assert(!res);
analytics.assert(err === 'Internal Server Error');
analytics.assert.equal(err, 'Internal Server Error');

@@ -1277,2 +1271,11 @@ assert.equal(segment.getCachedCrossDomainId(), null);

);
server.respondWith(
'GET',
'https://localhost/v1/id/' + segment.options.apiKey,
[
200,
{ 'Content-Type': 'application/json' },
'{ "id": null }'
]
);
server.respond();

@@ -1279,0 +1282,0 @@

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