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

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,36 @@ 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
+ existingSkills?: string[]; // max items 7, any more are discarded
69
+ desiredSkills?: string[]; // max items 7, any more are discarded
70
+ }
71
+
72
+ export type FeatureAttributes = FeatureAttributesAIChat
73
+
74
+ export interface AdditionalUserInfo {
75
+ jobTitle: string;
72
76
  }
73
77
 
74
78
  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
79
+ /** Mandatory identifier for the embedded feature */
80
+ feature: 'ai-chat' | 'content-hub' | 'preview';
81
+ /** Optional parameters to configure the feature. See associated types for examples */
82
+ featureAttributes?: FeatureAttributes;
83
+ /** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
84
+ portalURL?: string;
85
+ /** Optional function that is invoked when the Go1 content view emits a message */
86
+ onGo1MessageReceived?: OnGo1MessageReceived;
87
+ /** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
88
+ additionalUserInfo?: AdditionalUserInfo;
89
+ /** Optional UI configuration */
90
+ themeInformation?: ThemeInformation
91
+ /** Optional token that is used to pre-authorize the user without them needing to log in */
92
+ oneTimeToken?: string;
82
93
  }
83
94
  ```
84
95
 
@@ -109,12 +120,11 @@ const options = useMemo<ContentViewProps>(() => {
109
120
  feature: 'ai-chat',
110
121
  portalURL: 'learning-incorporated-usa.mygo1.com',
111
122
  featureAttributes: {
112
- id: 32973,
123
+ experience: 'manager',
113
124
  },
114
125
  onGo1MessageReceived,
115
126
  additionalUserInfo: {
116
- department: 'sales',
117
- goals: ['leadership', 'management']
127
+ jobTitle: 'Sales development representative'
118
128
  },
119
129
  themeInformation: {
120
130
  accent: '#0437F2'
package/dist/README.md CHANGED
@@ -60,25 +60,36 @@ 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
+ existingSkills?: string[]; // max items 7, any more are discarded
69
+ desiredSkills?: string[]; // max items 7, any more are discarded
70
+ }
71
+
72
+ export type FeatureAttributes = FeatureAttributesAIChat
73
+
74
+ export interface AdditionalUserInfo {
75
+ jobTitle: string;
72
76
  }
73
77
 
74
78
  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
79
+ /** Mandatory identifier for the embedded feature */
80
+ feature: 'ai-chat' | 'content-hub' | 'preview';
81
+ /** Optional parameters to configure the feature. See associated types for examples */
82
+ featureAttributes?: FeatureAttributes;
83
+ /** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
84
+ portalURL?: string;
85
+ /** Optional function that is invoked when the Go1 content view emits a message */
86
+ onGo1MessageReceived?: OnGo1MessageReceived;
87
+ /** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
88
+ additionalUserInfo?: AdditionalUserInfo;
89
+ /** Optional UI configuration */
90
+ themeInformation?: ThemeInformation
91
+ /** Optional token that is used to pre-authorize the user without them needing to log in */
92
+ oneTimeToken?: string;
82
93
  }
83
94
  ```
84
95
 
@@ -109,12 +120,11 @@ const options = useMemo<ContentViewProps>(() => {
109
120
  feature: 'ai-chat',
110
121
  portalURL: 'learning-incorporated-usa.mygo1.com',
111
122
  featureAttributes: {
112
- id: 32973,
123
+ experience: 'manager',
113
124
  },
114
125
  onGo1MessageReceived,
115
126
  additionalUserInfo: {
116
- department: 'sales',
117
- goals: ['leadership', 'management']
127
+ jobTitle: 'Sales development representative'
118
128
  },
119
129
  themeInformation: {
120
130
  accent: '#0437F2'
@@ -15,14 +15,18 @@ 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
+ existingSkills?: string[];
22
+ desiredSkills?: string[];
20
23
  }
24
+ export type FeatureAttributes = FeatureAttributesAIChat;
21
25
  export interface AdditionalUserInfo {
22
- [key: string]: any;
26
+ jobTitle: string;
23
27
  }
24
28
  export interface InitOptions {
25
- feature: string;
29
+ feature: 'ai-chat' | 'content-hub' | 'preview';
26
30
  iframeParentId?: string;
27
31
  iframeParentElement?: HTMLElement;
28
32
  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.5",
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": [