Skip to content

Commit bb5a176

Browse files
chore(build): Generate latest bundle [skip ci]
1 parent 78061a5 commit bb5a176

File tree

2 files changed

+94
-2
lines changed

2 files changed

+94
-2
lines changed

dist/Rokt-Kit.common.js

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,49 @@ var constructor = function () {
599599
function onUserIdentified(filteredUser) {
600600
self.filters.filteredUser = filteredUser;
601601
self.userAttributes = filteredUser.getAllUserAttributes();
602+
_sendEventStream(_buildIdentityEvent('identify', filteredUser));
603+
}
604+
605+
function _buildIdentityEvent(eventName, filteredUser) {
606+
var mpid =
607+
filteredUser.getMPID && typeof filteredUser.getMPID === 'function'
608+
? filteredUser.getMPID()
609+
: null;
610+
var sessionId =
611+
window.mParticle &&
612+
window.mParticle.sessionManager &&
613+
typeof window.mParticle.sessionManager.getSession === 'function'
614+
? window.mParticle.sessionManager.getSession()
615+
: null;
616+
var userIdentities =
617+
filteredUser.getUserIdentities &&
618+
typeof filteredUser.getUserIdentities === 'function'
619+
? filteredUser.getUserIdentities().userIdentities
620+
: null;
621+
622+
return {
623+
EventName: eventName,
624+
EventDataType: 14, // MessageType.Profile
625+
Timestamp: Date.now(),
626+
MPID: mpid,
627+
SessionId: sessionId,
628+
UserIdentities: userIdentities,
629+
};
630+
}
631+
632+
function onLoginComplete(filteredUser) {
633+
self.userAttributes = filteredUser.getAllUserAttributes();
634+
_sendEventStream(_buildIdentityEvent('login', filteredUser));
635+
}
636+
637+
function onLogoutComplete(filteredUser) {
638+
self.userAttributes = filteredUser.getAllUserAttributes();
639+
_sendEventStream(_buildIdentityEvent('logout', filteredUser));
640+
}
641+
642+
function onModifyComplete(filteredUser) {
643+
self.userAttributes = filteredUser.getAllUserAttributes();
644+
_sendEventStream(_buildIdentityEvent('modify_user', filteredUser));
602645
}
603646

604647
function setUserAttribute(key, value) {
@@ -717,6 +760,9 @@ var constructor = function () {
717760
this.setExtensionData = setExtensionData;
718761
this.setUserAttribute = setUserAttribute;
719762
this.onUserIdentified = onUserIdentified;
763+
this.onLoginComplete = onLoginComplete;
764+
this.onLogoutComplete = onLogoutComplete;
765+
this.onModifyComplete = onModifyComplete;
720766
this.removeUserAttribute = removeUserAttribute;
721767

722768
/**
@@ -825,7 +871,7 @@ var constructor = function () {
825871

826872
function generateIntegrationName(customIntegrationName) {
827873
var coreSdkVersion = window.mParticle.getVersion();
828-
var kitVersion = "1.19.0";
874+
var kitVersion = "1.20.0";
829875
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
830876

831877
if (customIntegrationName) {

dist/Rokt-Kit.iife.js

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,49 @@ var RoktKit = (function (exports) {
598598
function onUserIdentified(filteredUser) {
599599
self.filters.filteredUser = filteredUser;
600600
self.userAttributes = filteredUser.getAllUserAttributes();
601+
_sendEventStream(_buildIdentityEvent('identify', filteredUser));
602+
}
603+
604+
function _buildIdentityEvent(eventName, filteredUser) {
605+
var mpid =
606+
filteredUser.getMPID && typeof filteredUser.getMPID === 'function'
607+
? filteredUser.getMPID()
608+
: null;
609+
var sessionId =
610+
window.mParticle &&
611+
window.mParticle.sessionManager &&
612+
typeof window.mParticle.sessionManager.getSession === 'function'
613+
? window.mParticle.sessionManager.getSession()
614+
: null;
615+
var userIdentities =
616+
filteredUser.getUserIdentities &&
617+
typeof filteredUser.getUserIdentities === 'function'
618+
? filteredUser.getUserIdentities().userIdentities
619+
: null;
620+
621+
return {
622+
EventName: eventName,
623+
EventDataType: 14, // MessageType.Profile
624+
Timestamp: Date.now(),
625+
MPID: mpid,
626+
SessionId: sessionId,
627+
UserIdentities: userIdentities,
628+
};
629+
}
630+
631+
function onLoginComplete(filteredUser) {
632+
self.userAttributes = filteredUser.getAllUserAttributes();
633+
_sendEventStream(_buildIdentityEvent('login', filteredUser));
634+
}
635+
636+
function onLogoutComplete(filteredUser) {
637+
self.userAttributes = filteredUser.getAllUserAttributes();
638+
_sendEventStream(_buildIdentityEvent('logout', filteredUser));
639+
}
640+
641+
function onModifyComplete(filteredUser) {
642+
self.userAttributes = filteredUser.getAllUserAttributes();
643+
_sendEventStream(_buildIdentityEvent('modify_user', filteredUser));
601644
}
602645

603646
function setUserAttribute(key, value) {
@@ -716,6 +759,9 @@ var RoktKit = (function (exports) {
716759
this.setExtensionData = setExtensionData;
717760
this.setUserAttribute = setUserAttribute;
718761
this.onUserIdentified = onUserIdentified;
762+
this.onLoginComplete = onLoginComplete;
763+
this.onLogoutComplete = onLogoutComplete;
764+
this.onModifyComplete = onModifyComplete;
719765
this.removeUserAttribute = removeUserAttribute;
720766

721767
/**
@@ -824,7 +870,7 @@ var RoktKit = (function (exports) {
824870

825871
function generateIntegrationName(customIntegrationName) {
826872
var coreSdkVersion = window.mParticle.getVersion();
827-
var kitVersion = "1.19.0";
873+
var kitVersion = "1.20.0";
828874
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
829875

830876
if (customIntegrationName) {

0 commit comments

Comments
 (0)