@shrfe/assets 1.0.71 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36652,6 +36652,33 @@ const PROFILE_KEY_MAP = {
36652
36652
  firstName: 'first_name',
36653
36653
  lastName: 'last_name'
36654
36654
  };
36655
+ // Customer.io's documented person attributes; any other profile key is dropped before identify.
36656
+ const CUSTOMER_IO_ATTRIBUTES = new Set([
36657
+ 'first_name',
36658
+ 'last_name',
36659
+ 'gender',
36660
+ 'email',
36661
+ 'phone_number',
36662
+ 'employer_name',
36663
+ 'employer_address',
36664
+ 'date_joined',
36665
+ 'time_in_company',
36666
+ 'employee_id',
36667
+ 'job_title',
36668
+ 'department',
36669
+ 'breeze_user_id',
36670
+ 'channel',
36671
+ 'date_of_birth',
36672
+ 'location',
36673
+ 'country',
36674
+ 'payday',
36675
+ 'breeze_access_status',
36676
+ 'breeze_access_date',
36677
+ 'total_amount_eligible',
36678
+ 'repayment_status',
36679
+ 'device',
36680
+ 'number_of_loans'
36681
+ ]);
36655
36682
  // Where the SDK persists the identified person (localStorage and cookies).
36656
36683
  const STORED_IDENTITY_KEYS = [
36657
36684
  'ajs_user_id',
@@ -36770,7 +36797,11 @@ const CustomerIoService = {
36770
36797
  },
36771
36798
  identify (userId, profile) {
36772
36799
  if (userId === undefined || userId === null || userId === '') return;
36773
- const traits = toProfileTraits(profile);
36800
+ const attributeProfile = {};
36801
+ CUSTOMER_IO_ATTRIBUTES.forEach((name)=>{
36802
+ if (profile && name in profile) attributeProfile[name] = profile[name];
36803
+ });
36804
+ const traits = toProfileTraits(attributeProfile);
36774
36805
  log('identify', userId, traits);
36775
36806
  safely((client)=>client.identify(String(userId), traits));
36776
36807
  },
@@ -72494,8 +72525,8 @@ MixpanelService.trackEvent = (nodeEnv, eventName, payload)=>{
72494
72525
  // Analytics must never break the user flow.
72495
72526
  }
72496
72527
  }
72497
- // Customer.io campaigns use the same events. This does nothing unless
72498
- // CustomerIoService.init() received a write key.
72528
+ // Customer.io campaigns use the same events, but only in production so dev and
72529
+ // staging data don't pollute Customer.io (and only when init() got a write key).
72499
72530
  if (nodeEnv === 'production') {
72500
72531
  customerio_service.trackEvent(eventName, payload);
72501
72532
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrfe/assets",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "The assets used in SeamlessHR products",
5
5
  "author": "SeamlessHR LTD <oludayo@seamlesshr.com>",
6
6
  "license": "ISC",