@go1/go1-embedding-react-sdk 0.9.4 → 0.11.0

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.
package/README.md CHANGED
@@ -56,6 +56,7 @@ export interface FeatureAttributeCommon {
56
56
  shouldSuppressOpeningPlayer?: boolean;
57
57
  shouldShowSelectWelcomeModal?: boolean;
58
58
  shouldSuppressBookmark?: boolean;
59
+ shouldSuppressBookmarkAction?: boolean;
59
60
  shouldSuppressPlaylistAdministration?: boolean;
60
61
  shouldSuppressShareLink?: boolean;
61
62
  shouldSuppressLibrary?: boolean;
@@ -102,7 +103,9 @@ export type Go1MessageType =
102
103
  | 'swap_out_open'
103
104
  | 'swap_out_close'
104
105
  | 'play_content'
105
- | 'library_content_added';
106
+ | 'library_content_added'
107
+ | 'library_content_removed'
108
+ | 'save_content';
106
109
 
107
110
  export interface Go1Message {
108
111
  type: Go1MessageType;
@@ -115,6 +118,7 @@ export interface FeatureAttributeCommon {
115
118
  shouldSuppressOpeningPlayer?: boolean;
116
119
  shouldShowSelectWelcomeModal?: boolean;
117
120
  shouldSuppressBookmark?: boolean;
121
+ shouldSuppressBookmarkAction?: boolean;
118
122
  shouldSuppressPlaylistAdministration?: boolean;
119
123
  shouldSuppressShareLink?: boolean;
120
124
  shouldSuppressLibrary?: boolean;
@@ -127,7 +131,8 @@ export interface FeatureAttributeCommon {
127
131
  }
128
132
 
129
133
  /**
130
- * Used to configure the `ai-chat` feature
134
+ * @deprecated Use `feature: 'discovery-agent'` instead.
135
+ * Used to configure the `ai-chat` feature.
131
136
  */
132
137
  export interface FeatureAttributesAIChat extends FeatureAttributeCommon {
133
138
  intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
@@ -138,6 +143,13 @@ export interface FeatureAttributesAIChat extends FeatureAttributeCommon {
138
143
  showFooter?: boolean // Whether to show/hide the footer, defaults to true
139
144
  }
140
145
 
146
+ /**
147
+ * Used to configure the `discovery-agent` feature
148
+ */
149
+ export interface FeatureAttributesDiscoveryAgent extends FeatureAttributeCommon {
150
+ message?: string; // The desired message to start the chat, which will be shown to the user
151
+ }
152
+
141
153
  /**
142
154
  * Used to configure the `preview` feature
143
155
  */
@@ -190,6 +202,7 @@ export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSea
190
202
 
191
203
  export type FeatureAttributes =
192
204
  | FeatureAttributesAIChat
205
+ | FeatureAttributesDiscoveryAgent
193
206
  | FeatureAttributesPreview
194
207
  | FeatureAttributesWallet
195
208
  | FeatureAttributesLibrary
@@ -201,7 +214,9 @@ export interface AdditionalUserInfo {
201
214
  }
202
215
 
203
216
  export type FeatureType =
217
+ /** @deprecated Use 'discovery-agent' instead. */
204
218
  | 'ai-chat'
219
+ | 'discovery-agent'
205
220
  /** @deprecated Use 'admin-curation' instead. */
206
221
  | 'content-hub'
207
222
  | 'preview'
@@ -242,6 +257,9 @@ export interface InitOptions {
242
257
  `admin-curation` for new integrations. Existing `content-hub` requests are
243
258
  redirected server-side to `admin-curation` during the deprecation window.
244
259
 
260
+ `ai-chat` is deprecated and will be removed in a future major release. Use
261
+ `discovery-agent` for new integrations.
262
+
245
263
  ## Function: `useGo1ContentView`
246
264
 
247
265
  A react hook that will return
@@ -344,7 +362,55 @@ Item has been added to the library
344
362
  "type": "library_content_added",
345
363
  "payload": {
346
364
  "id": "3510462",
347
- "type": "lo"
365
+ "action_type": "admin-add",
366
+ "timestamp": "2026-06-16T02:13:45.123Z",
367
+ "type": "lo",
368
+ "lo_type": "course"
369
+ }
370
+ }
371
+ ```
372
+
373
+ Item has been removed from the library
374
+
375
+ ```typescript
376
+ {
377
+ "type": "library_content_removed",
378
+ "payload": {
379
+ "id": "3510462",
380
+ "action_type": "admin-remove",
381
+ "timestamp": "2026-06-16T02:13:45.123Z",
382
+ "type": "lo",
383
+ "lo_type": "course"
384
+ }
385
+ }
386
+ ```
387
+
388
+ Item bookmark action has been requested by a learner while `shouldSuppressBookmarkAction` is enabled
389
+
390
+ ```typescript
391
+ {
392
+ "type": "save_content",
393
+ "payload": {
394
+ "id": "3510462",
395
+ "action_type": "learner-save",
396
+ "timestamp": "2026-06-16T02:13:45.123Z",
397
+ "type": "lo",
398
+ "lo_type": "course"
399
+ }
400
+ }
401
+ ```
402
+
403
+ Item bookmark action has been requested by an admin while `shouldSuppressBookmarkAction` is enabled
404
+
405
+ ```typescript
406
+ {
407
+ "type": "save_content",
408
+ "payload": {
409
+ "id": "3510462",
410
+ "action_type": "admin-save",
411
+ "timestamp": "2026-06-16T02:13:45.123Z",
412
+ "type": "lo",
413
+ "lo_type": "course"
348
414
  }
349
415
  }
350
416
  ```
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @go1/go1-embedding-react-sdk
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add shouldSuppressBookmarkAction and save_content event payload support.
8
+
9
+ ## 0.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Update the schema of event library_content_added.
14
+ - Add new message library_content_removed.
15
+
3
16
  ## 0.9.4
4
17
 
5
18
  ### Patch Changes
package/dist/README.md CHANGED
@@ -56,6 +56,7 @@ export interface FeatureAttributeCommon {
56
56
  shouldSuppressOpeningPlayer?: boolean;
57
57
  shouldShowSelectWelcomeModal?: boolean;
58
58
  shouldSuppressBookmark?: boolean;
59
+ shouldSuppressBookmarkAction?: boolean;
59
60
  shouldSuppressPlaylistAdministration?: boolean;
60
61
  shouldSuppressShareLink?: boolean;
61
62
  shouldSuppressLibrary?: boolean;
@@ -102,7 +103,9 @@ export type Go1MessageType =
102
103
  | 'swap_out_open'
103
104
  | 'swap_out_close'
104
105
  | 'play_content'
105
- | 'library_content_added';
106
+ | 'library_content_added'
107
+ | 'library_content_removed'
108
+ | 'save_content';
106
109
 
107
110
  export interface Go1Message {
108
111
  type: Go1MessageType;
@@ -115,6 +118,7 @@ export interface FeatureAttributeCommon {
115
118
  shouldSuppressOpeningPlayer?: boolean;
116
119
  shouldShowSelectWelcomeModal?: boolean;
117
120
  shouldSuppressBookmark?: boolean;
121
+ shouldSuppressBookmarkAction?: boolean;
118
122
  shouldSuppressPlaylistAdministration?: boolean;
119
123
  shouldSuppressShareLink?: boolean;
120
124
  shouldSuppressLibrary?: boolean;
@@ -127,7 +131,8 @@ export interface FeatureAttributeCommon {
127
131
  }
128
132
 
129
133
  /**
130
- * Used to configure the `ai-chat` feature
134
+ * @deprecated Use `feature: 'discovery-agent'` instead.
135
+ * Used to configure the `ai-chat` feature.
131
136
  */
132
137
  export interface FeatureAttributesAIChat extends FeatureAttributeCommon {
133
138
  intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
@@ -138,6 +143,13 @@ export interface FeatureAttributesAIChat extends FeatureAttributeCommon {
138
143
  showFooter?: boolean // Whether to show/hide the footer, defaults to true
139
144
  }
140
145
 
146
+ /**
147
+ * Used to configure the `discovery-agent` feature
148
+ */
149
+ export interface FeatureAttributesDiscoveryAgent extends FeatureAttributeCommon {
150
+ message?: string; // The desired message to start the chat, which will be shown to the user
151
+ }
152
+
141
153
  /**
142
154
  * Used to configure the `preview` feature
143
155
  */
@@ -190,6 +202,7 @@ export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSea
190
202
 
191
203
  export type FeatureAttributes =
192
204
  | FeatureAttributesAIChat
205
+ | FeatureAttributesDiscoveryAgent
193
206
  | FeatureAttributesPreview
194
207
  | FeatureAttributesWallet
195
208
  | FeatureAttributesLibrary
@@ -201,7 +214,9 @@ export interface AdditionalUserInfo {
201
214
  }
202
215
 
203
216
  export type FeatureType =
217
+ /** @deprecated Use 'discovery-agent' instead. */
204
218
  | 'ai-chat'
219
+ | 'discovery-agent'
205
220
  /** @deprecated Use 'admin-curation' instead. */
206
221
  | 'content-hub'
207
222
  | 'preview'
@@ -242,6 +257,9 @@ export interface InitOptions {
242
257
  `admin-curation` for new integrations. Existing `content-hub` requests are
243
258
  redirected server-side to `admin-curation` during the deprecation window.
244
259
 
260
+ `ai-chat` is deprecated and will be removed in a future major release. Use
261
+ `discovery-agent` for new integrations.
262
+
245
263
  ## Function: `useGo1ContentView`
246
264
 
247
265
  A react hook that will return
@@ -344,7 +362,55 @@ Item has been added to the library
344
362
  "type": "library_content_added",
345
363
  "payload": {
346
364
  "id": "3510462",
347
- "type": "lo"
365
+ "action_type": "admin-add",
366
+ "timestamp": "2026-06-16T02:13:45.123Z",
367
+ "type": "lo",
368
+ "lo_type": "course"
369
+ }
370
+ }
371
+ ```
372
+
373
+ Item has been removed from the library
374
+
375
+ ```typescript
376
+ {
377
+ "type": "library_content_removed",
378
+ "payload": {
379
+ "id": "3510462",
380
+ "action_type": "admin-remove",
381
+ "timestamp": "2026-06-16T02:13:45.123Z",
382
+ "type": "lo",
383
+ "lo_type": "course"
384
+ }
385
+ }
386
+ ```
387
+
388
+ Item bookmark action has been requested by a learner while `shouldSuppressBookmarkAction` is enabled
389
+
390
+ ```typescript
391
+ {
392
+ "type": "save_content",
393
+ "payload": {
394
+ "id": "3510462",
395
+ "action_type": "learner-save",
396
+ "timestamp": "2026-06-16T02:13:45.123Z",
397
+ "type": "lo",
398
+ "lo_type": "course"
399
+ }
400
+ }
401
+ ```
402
+
403
+ Item bookmark action has been requested by an admin while `shouldSuppressBookmarkAction` is enabled
404
+
405
+ ```typescript
406
+ {
407
+ "type": "save_content",
408
+ "payload": {
409
+ "id": "3510462",
410
+ "action_type": "admin-save",
411
+ "timestamp": "2026-06-16T02:13:45.123Z",
412
+ "type": "lo",
413
+ "lo_type": "course"
348
414
  }
349
415
  }
350
416
  ```
@@ -43,6 +43,7 @@ function isValidFeature(feature) {
43
43
  return types_1.features.includes(feature);
44
44
  }
45
45
  exports.DEPRECATED_FEATURES = {
46
+ 'ai-chat': 'discovery-agent',
46
47
  'content-hub': 'admin-curation',
47
48
  };
48
49
  function warnIfDeprecatedFeature(feature) {
@@ -26,7 +26,24 @@ export interface ThemeInformationElysium {
26
26
  mode?: ThemeMode;
27
27
  }
28
28
  export type ThemeInformationPayload = ThemeInformation | ThemeInformationElysium | ThemeModeInformation;
29
- export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'set_access_token' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal' | 'update_experience' | 'inter_feature_navigation' | 'side_drawer_open' | 'side_drawer_close' | 'play_content' | 'go1pay_custom_data' | 'bulk_upload_content' | 'bulk_upload_metadata' | 'bulk_retirement_request' | 'bulk_upload_close' | 'contact_go1_navigation' | 'library_content_added';
29
+ export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'set_access_token' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal' | 'update_experience' | 'inter_feature_navigation' | 'side_drawer_open' | 'side_drawer_close' | 'play_content' | 'go1pay_custom_data' | 'bulk_upload_content' | 'bulk_upload_metadata' | 'bulk_retirement_request' | 'bulk_upload_close' | 'contact_go1_navigation' | 'library_content_added' | 'library_content_removed' | 'save_content';
30
+ export type LibraryContentAddedActionType = 'admin-add';
31
+ export type LibraryContentRemovedActionType = 'admin-remove';
32
+ export type SaveContentActionType = 'learner-save' | 'admin-save';
33
+ export type LibraryContentAddedContentType = 'lo' | 'playlist';
34
+ export interface LibraryContentMessagePayload {
35
+ id: string;
36
+ action_type: LibraryContentAddedActionType | LibraryContentRemovedActionType | SaveContentActionType;
37
+ timestamp: string;
38
+ type?: LibraryContentAddedContentType;
39
+ lo_type?: string;
40
+ }
41
+ export interface LibraryContentAddedPayload extends LibraryContentMessagePayload {
42
+ action_type: LibraryContentAddedActionType;
43
+ }
44
+ export interface LibraryContentRemovedPayload extends LibraryContentMessagePayload {
45
+ action_type: LibraryContentRemovedActionType;
46
+ }
30
47
  interface Go1MessageUpdateExperience {
31
48
  type: 'update_experience';
32
49
  payload: {
@@ -44,6 +61,7 @@ export interface FeatureAttributeCommon {
44
61
  shouldSuppressOpeningPlayer?: boolean;
45
62
  shouldShowSelectWelcomeModal?: boolean;
46
63
  shouldSuppressBookmark?: boolean;
64
+ shouldSuppressBookmarkAction?: boolean;
47
65
  shouldSuppressPlaylistAdministration?: boolean;
48
66
  shouldSuppressShareLink?: boolean;
49
67
  shouldSuppressLibrary?: boolean;
@@ -69,6 +87,9 @@ export interface FeatureAttributesAIChat extends FeatureAttributesPreviewCommon
69
87
  desiredRole?: string;
70
88
  showFooter?: boolean;
71
89
  }
90
+ export interface FeatureAttributesDiscoveryAgent extends FeatureAttributeCommon {
91
+ message?: string;
92
+ }
72
93
  export interface FeatureAttributesPreview extends FeatureAttributesPreviewCommon {
73
94
  id: number;
74
95
  }
@@ -118,12 +139,12 @@ export type SearchLearningObjectsOptions = {
118
139
  sort?: string;
119
140
  };
120
141
  export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSearch, 'searchProvider'> & SearchLearningObjectsOptions;
121
- export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview | FeatureAttributesWallet | FeatureAttributesLibrary | FeatureAttributesSearch | FeatureAttributesMyLearning | FeatureAttributesBulkUpload | FeatureAttributesContentStatus | FeatureAttributesGo1LearnSearch | FeatureAttributesRecommendations;
142
+ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesDiscoveryAgent | FeatureAttributesPreview | FeatureAttributesWallet | FeatureAttributesLibrary | FeatureAttributesSearch | FeatureAttributesMyLearning | FeatureAttributesBulkUpload | FeatureAttributesContentStatus | FeatureAttributesGo1LearnSearch | FeatureAttributesRecommendations;
122
143
  export interface AdditionalUserInfo {
123
144
  jobTitle: string;
124
145
  }
125
- export declare const features: readonly ["activity-feed", "ai-chat", "admin-curation", "auth-clients", "auth-clients-public", "go1-learn/library", "go1-learn/my-learning", "go1-learn/search", "go1-learn/search-categories", "bulk-upload", "content-hub", "content-status", "partner-sales", "preview", "recommendations", "search", "wallet"];
126
- export type FeatureType = Exclude<(typeof features)[number], 'content-hub'> | 'content-hub';
146
+ export declare const features: readonly ["activity-feed", "ai-chat", "admin-curation", "auth-clients", "auth-clients-public", "discovery-agent", "go1-learn/library", "go1-learn/my-learning", "go1-learn/search", "go1-learn/search-categories", "bulk-upload", "content-hub", "content-status", "partner-sales", "preview", "recommendations", "search", "wallet"];
147
+ export type FeatureType = Exclude<(typeof features)[number], 'ai-chat' | 'content-hub'> | 'ai-chat' | 'content-hub';
127
148
  export interface InitOptions {
128
149
  feature: FeatureType;
129
150
  iframeParentId?: string;
@@ -7,6 +7,7 @@ exports.features = [
7
7
  'admin-curation',
8
8
  'auth-clients',
9
9
  'auth-clients-public',
10
+ 'discovery-agent',
10
11
  'go1-learn/library',
11
12
  'go1-learn/my-learning',
12
13
  'go1-learn/search',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.9.4",
3
+ "version": "0.11.0",
4
4
  "description": "A React library to embed Go1 content into your website.",
5
5
  "main": "dist/go1-embedding-react-sdk/src/index.js",
6
6
  "files": [