@smartico/public-api 0.0.324 → 0.0.325

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.
@@ -920,6 +920,72 @@ Requests translations for the given language. Returns the object including trans
920
920
 
921
921
  ___
922
922
 
923
+ ### reportImpressionEvent
924
+
925
+ ▸ **reportImpressionEvent**(`«destructured»`): `void`
926
+
927
+ Reports an impression event for an engagement (when engagement content is displayed to the user).
928
+ Use this method to track when users view engagement content such as inbox messages, popups.
929
+ When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
930
+
931
+ **Example**:
932
+ ```
933
+ _smartico.api.reportImpressionEvent({
934
+ engagement_uid: 'abc123-def456',
935
+ activityType: 31 // Inbox
936
+ });
937
+ ```
938
+
939
+ **Visitor mode: not supported**
940
+
941
+ #### Parameters
942
+
943
+ | Name | Type |
944
+ | :------ | :------ |
945
+ | `«destructured»` | `Object` |
946
+ | › `engagement_uid` | `string` |
947
+ | › `activityType` | `number` |
948
+
949
+ #### Returns
950
+
951
+ `void`
952
+
953
+ ___
954
+
955
+ ### reportClickEvent
956
+
957
+ ▸ **reportClickEvent**(`«destructured»`): `void`
958
+
959
+ Reports a click/action event for an engagement (when user interacts with engagement content).
960
+ Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
961
+ When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
962
+
963
+ **Example**:
964
+ ```
965
+ _smartico.api.reportClickEvent({
966
+ engagement_uid: 'abc123-def456',
967
+ activityType: 31 // Inbox,
968
+ action: 'dp:gf_missions'
969
+ });
970
+ ```
971
+
972
+ **Visitor mode: not supported**
973
+
974
+ #### Parameters
975
+
976
+ | Name | Type |
977
+ | :------ | :------ |
978
+ | `«destructured»` | `Object` |
979
+ | › `engagement_uid` | `string` |
980
+ | › `activityType` | `number` |
981
+ | › `action?` | `string` |
982
+
983
+ #### Returns
984
+
985
+ `void`
986
+
987
+ ___
988
+
923
989
  ### jackpotGet
924
990
 
925
991
  ▸ **jackpotGet**(`filter?`): `Promise`\<[`JackpotDetails`](../interfaces/JackpotDetails.md)[]\>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.324",
3
+ "version": "0.0.325",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,6 +19,7 @@ import {
19
19
  } from './MiniGames';
20
20
  import { ECacheContext, OCache } from './OCache';
21
21
  import {
22
+ ActivityTypeLimited,
22
23
  CoreUtils,
23
24
  GetTranslationsRequest,
24
25
  GetTranslationsResponse,
@@ -460,6 +461,40 @@ class SmarticoAPI {
460
461
  return results.segments || [];
461
462
  }
462
463
 
464
+ /**
465
+ * Reports an engagement impression event (when engagement content is displayed to the user).
466
+ */
467
+ public reportEngagementImpression(
468
+ user_ext_id: string,
469
+ engagement_uid: string,
470
+ activityType: ActivityTypeLimited | number,
471
+ ): void {
472
+ const message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {
473
+ engagement_uid,
474
+ activityType,
475
+ });
476
+
477
+ this.send(message).catch(() => {});
478
+ }
479
+
480
+ /**
481
+ * Reports an engagement action event (when user clicks/interacts with engagement content).
482
+ */
483
+ public reportEngagementAction(
484
+ user_ext_id: string,
485
+ engagement_uid: string,
486
+ activityType: ActivityTypeLimited | number,
487
+ action?: string,
488
+ ): void {
489
+ const message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, {
490
+ engagement_uid,
491
+ activityType,
492
+ ...(action && { action }),
493
+ });
494
+
495
+ this.send(message).catch(() => {});
496
+ }
497
+
463
498
  public async jackpotGet(
464
499
  user_ext_id: string,
465
500
  filter?: { related_game_id?: string; jp_template_id?: number },
@@ -1,5 +1,5 @@
1
1
  import { ClassId } from '../Base/ClassId';
2
- import { CoreUtils } from '../Core';
2
+ import { ActivityTypeLimited, CoreUtils } from '../Core';
3
3
  import {
4
4
  SAWSpinsCountPush,
5
5
  } from '../MiniGames';
@@ -945,6 +945,67 @@ export class WSAPI {
945
945
  };
946
946
  }
947
947
 
948
+ /**
949
+ * Reports an impression event for an engagement (when engagement content is displayed to the user).
950
+ * Use this method to track when users view engagement content such as inbox messages, popups.
951
+ * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
952
+ *
953
+ * **Example**:
954
+ * ```
955
+ * _smartico.api.reportImpressionEvent({
956
+ * engagement_uid: 'abc123-def456',
957
+ * activityType: 31 // Inbox
958
+ * });
959
+ * ```
960
+ *
961
+ * **Visitor mode: not supported**
962
+ *
963
+ * @param params.engagement_uid - Unique identifier for the engagement
964
+ * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
965
+ */
966
+ public reportImpressionEvent({
967
+ engagement_uid,
968
+ activityType,
969
+ }: {
970
+ engagement_uid: string;
971
+ activityType: ActivityTypeLimited | number;
972
+ }): void {
973
+ this.api.reportEngagementImpression(null, engagement_uid, activityType);
974
+ }
975
+
976
+ /**
977
+ * Reports a click/action event for an engagement (when user interacts with engagement content).
978
+ * Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
979
+ * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
980
+ *
981
+ *
982
+ * **Example**:
983
+ * ```
984
+ * _smartico.api.reportClickEvent({
985
+ * engagement_uid: 'abc123-def456',
986
+ * activityType: 31 // Inbox,
987
+ * action: 'dp:gf_missions'
988
+ * });
989
+ * ```
990
+ *
991
+ * **Visitor mode: not supported**
992
+ *
993
+ * @param params.engagement_uid - Unique identifier for the engagement
994
+ * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
995
+ * @param params.action - Optional action/deeplink that was triggered by the user interaction
996
+ */
997
+ public reportClickEvent({
998
+ engagement_uid,
999
+ activityType,
1000
+ action,
1001
+ }: {
1002
+ engagement_uid: string;
1003
+ activityType: ActivityTypeLimited | number;
1004
+ action?: string;
1005
+ }): void {
1006
+ this.api.reportEngagementAction(null, engagement_uid, activityType, action);
1007
+ }
1008
+
948
1009
  private async updateOnSpin(data: SAWSpinsCountPush) {
949
1010
  const templates: TMiniGameTemplate[] = await OCache.use(
950
1011
  onUpdateContextKey.Saw,