@survicate/survicate-web-package 22.0.0-npm → 22.3.0-npm
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 +21 -8
- package/package.json +1 -1
- package/survicate_widget.d.ts +1 -0
- package/survicate_widget.js +1 -1
package/README.md
CHANGED
|
@@ -9,22 +9,35 @@ It's built on top of [Preact](https://github.com/preactjs/preact) using [Typescr
|
|
|
9
9
|
# Initialization
|
|
10
10
|
Find your workspace key in the [Survicate Panel](https://panel.survicate.com/o/0/w/0/settings/access-keys).
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```javascript
|
|
13
13
|
import Survicate from '@survicate/survicate-web-package/survicate_widget'
|
|
14
14
|
|
|
15
15
|
const key = "..." // Your key from the panel
|
|
16
16
|
Survicate.init({workspaceKey: key});
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
All available methods can be found in our [documentation](https://developers.survicate.com/javascript/methods/).
|
|
19
|
+
## Examples:
|
|
21
20
|
|
|
21
|
+
To call available methods:
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
```javascript
|
|
24
|
+
import Survicate from '@survicate/survicate-web-package/survicate_widget'
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
// Initialize survicate:
|
|
27
|
+
const key = "..." // Your key from the panel
|
|
28
|
+
Survicate.init({workspaceKey: key});
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
Survicate.
|
|
30
|
+
// Show survey with force option
|
|
31
|
+
Survicate.showSurvey('surveyId', { forceDisplay: true });
|
|
32
|
+
|
|
33
|
+
// Set user attributes
|
|
34
|
+
Survicate.setVisitorTraits({name: 'userName', lastName: 'userLastName'});
|
|
35
|
+
|
|
36
|
+
// Add event listener
|
|
37
|
+
Survicate.addEventListener(ApiEvent.questionAnswered , () => console.log('question answered'));
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
// Remove eventListener
|
|
40
|
+
Survicate.removeEventListener(ApiEvent.questionAnswered);
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
*Please refer to the [documentation](https://developers.survicate.com/javascript/methods/) for the rest of the methods.*
|
package/package.json
CHANGED
package/survicate_widget.d.ts
CHANGED