@go1/go1-embedding-react-sdk 0.0.4 → 0.0.6

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
@@ -60,25 +60,37 @@ interface ThemeInformation {
60
60
  }
61
61
 
62
62
  /**
63
- * Used to specify how the feature should appear, or what data it should work with.
64
- * example:
65
- * {
66
- * id: 341134,
67
- * shouldShowHeading: false
68
- * }
63
+ * Used to configure the `ai-chat` feature
69
64
  */
70
- interface FeatureAttributes {
71
- [key: string]: number | string;
65
+ export interface FeatureAttributesAIChat {
66
+ experience: 'manager' | 'learner';
67
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
68
+ message?: string; // The desired message to start the chat, which will be shown to the user
69
+ existingSkills?: string[]; // max items 7, any more are discarded
70
+ desiredSkills?: string[]; // max items 7, any more are discarded
71
+ }
72
+
73
+ export type FeatureAttributes = FeatureAttributesAIChat
74
+
75
+ export interface AdditionalUserInfo {
76
+ jobTitle: string;
72
77
  }
73
78
 
74
79
  interface InitOptions {
75
- feature: string; // 'ai-chat' | 'explore' | 'preview';
76
- featureAttributes?: FeatureAttributes; // optional
77
- portalURL?: string; //optional
78
- onGo1MessageReceived?: OnGo1MessageReceived; //optional
79
- additionalUserInfo?: any; //optional
80
- themeInformation?: ThemeInformation; //optional
81
- oneTimeToken?: string; //optional
80
+ /** Mandatory identifier for the embedded feature */
81
+ feature: 'ai-chat' | 'content-hub' | 'preview';
82
+ /** Optional parameters to configure the feature. See associated types for examples */
83
+ featureAttributes?: FeatureAttributes;
84
+ /** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
85
+ portalURL?: string;
86
+ /** Optional function that is invoked when the Go1 content view emits a message */
87
+ onGo1MessageReceived?: OnGo1MessageReceived;
88
+ /** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
89
+ additionalUserInfo?: AdditionalUserInfo;
90
+ /** Optional UI configuration */
91
+ themeInformation?: ThemeInformation
92
+ /** Optional token that is used to pre-authorize the user without them needing to log in */
93
+ oneTimeToken?: string;
82
94
  }
83
95
  ```
84
96
 
@@ -109,12 +121,11 @@ const options = useMemo<ContentViewProps>(() => {
109
121
  feature: 'ai-chat',
110
122
  portalURL: 'learning-incorporated-usa.mygo1.com',
111
123
  featureAttributes: {
112
- id: 32973,
124
+ experience: 'manager',
113
125
  },
114
126
  onGo1MessageReceived,
115
127
  additionalUserInfo: {
116
- department: 'sales',
117
- goals: ['leadership', 'management']
128
+ jobTitle: 'Sales development representative'
118
129
  },
119
130
  themeInformation: {
120
131
  accent: '#0437F2'
package/dist/README.md CHANGED
@@ -60,25 +60,37 @@ interface ThemeInformation {
60
60
  }
61
61
 
62
62
  /**
63
- * Used to specify how the feature should appear, or what data it should work with.
64
- * example:
65
- * {
66
- * id: 341134,
67
- * shouldShowHeading: false
68
- * }
63
+ * Used to configure the `ai-chat` feature
69
64
  */
70
- interface FeatureAttributes {
71
- [key: string]: number | string;
65
+ export interface FeatureAttributesAIChat {
66
+ experience: 'manager' | 'learner';
67
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
68
+ message?: string; // The desired message to start the chat, which will be shown to the user
69
+ existingSkills?: string[]; // max items 7, any more are discarded
70
+ desiredSkills?: string[]; // max items 7, any more are discarded
71
+ }
72
+
73
+ export type FeatureAttributes = FeatureAttributesAIChat
74
+
75
+ export interface AdditionalUserInfo {
76
+ jobTitle: string;
72
77
  }
73
78
 
74
79
  interface InitOptions {
75
- feature: string; // 'ai-chat' | 'explore' | 'preview';
76
- featureAttributes?: FeatureAttributes; // optional
77
- portalURL?: string; //optional
78
- onGo1MessageReceived?: OnGo1MessageReceived; //optional
79
- additionalUserInfo?: any; //optional
80
- themeInformation?: ThemeInformation; //optional
81
- oneTimeToken?: string; //optional
80
+ /** Mandatory identifier for the embedded feature */
81
+ feature: 'ai-chat' | 'content-hub' | 'preview';
82
+ /** Optional parameters to configure the feature. See associated types for examples */
83
+ featureAttributes?: FeatureAttributes;
84
+ /** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
85
+ portalURL?: string;
86
+ /** Optional function that is invoked when the Go1 content view emits a message */
87
+ onGo1MessageReceived?: OnGo1MessageReceived;
88
+ /** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
89
+ additionalUserInfo?: AdditionalUserInfo;
90
+ /** Optional UI configuration */
91
+ themeInformation?: ThemeInformation
92
+ /** Optional token that is used to pre-authorize the user without them needing to log in */
93
+ oneTimeToken?: string;
82
94
  }
83
95
  ```
84
96
 
@@ -109,12 +121,11 @@ const options = useMemo<ContentViewProps>(() => {
109
121
  feature: 'ai-chat',
110
122
  portalURL: 'learning-incorporated-usa.mygo1.com',
111
123
  featureAttributes: {
112
- id: 32973,
124
+ experience: 'manager',
113
125
  },
114
126
  onGo1MessageReceived,
115
127
  additionalUserInfo: {
116
- department: 'sales',
117
- goals: ['leadership', 'management']
128
+ jobTitle: 'Sales development representative'
118
129
  },
119
130
  themeInformation: {
120
131
  accent: '#0437F2'
@@ -15,14 +15,19 @@ export interface Go1Message {
15
15
  type: string;
16
16
  payload?: any;
17
17
  }
18
- export interface FeatureAttributes {
19
- [key: string]: any;
18
+ export interface FeatureAttributesAIChat {
19
+ experience: 'manager' | 'learner';
20
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
21
+ message?: string;
22
+ existingSkills?: string[];
23
+ desiredSkills?: string[];
20
24
  }
25
+ export type FeatureAttributes = FeatureAttributesAIChat;
21
26
  export interface AdditionalUserInfo {
22
- [key: string]: any;
27
+ jobTitle: string;
23
28
  }
24
29
  export interface InitOptions {
25
- feature: string;
30
+ feature: 'ai-chat' | 'content-hub' | 'preview';
26
31
  iframeParentId?: string;
27
32
  iframeParentElement?: HTMLElement;
28
33
  featureAttributes?: FeatureAttributes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
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": [