@vapi-ai/web 1.0.180 → 1.0.181
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 +25 -0
- package/dist/vapi.js +2 -2
- package/package.json +1 -1
- package/vapi.ts +2 -2
package/README.md
CHANGED
|
@@ -47,6 +47,31 @@ vapi.stop();
|
|
|
47
47
|
|
|
48
48
|
This will stop the recording and close the connection.
|
|
49
49
|
|
|
50
|
+
## Events
|
|
51
|
+
|
|
52
|
+
You can listen to the following events:
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
vapi.on('speech-start', () => {
|
|
56
|
+
console.log('Speech has started');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
vapi.on('speech-end', () => {
|
|
60
|
+
console.log('Speech has ended');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
vapi.on('call-start', () => {
|
|
64
|
+
console.log('Call has started');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
vapi.on('call-end', () => {
|
|
68
|
+
console.log('Call has stopped');
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
These events allow you to react to changes in the state of the call or speech.
|
|
73
|
+
|
|
74
|
+
|
|
50
75
|
## License
|
|
51
76
|
|
|
52
77
|
```
|
package/dist/vapi.js
CHANGED
|
@@ -43,10 +43,10 @@ class Vapi extends events_1.default {
|
|
|
43
43
|
});
|
|
44
44
|
(_a = this.call.iframe()) === null || _a === void 0 ? void 0 : _a.style.setProperty("display", "none");
|
|
45
45
|
this.call.on("joined-meeting", () => {
|
|
46
|
-
this.emit("call-
|
|
46
|
+
this.emit("call-start");
|
|
47
47
|
});
|
|
48
48
|
this.call.on("left-meeting", () => {
|
|
49
|
-
this.emit("call-
|
|
49
|
+
this.emit("call-end");
|
|
50
50
|
});
|
|
51
51
|
yield this.call.join({ url });
|
|
52
52
|
this.call.startRemoteParticipantsAudioLevelObserver();
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -41,10 +41,10 @@ export default class Vapi extends EventEmitter {
|
|
|
41
41
|
this.call.iframe()?.style.setProperty("display", "none");
|
|
42
42
|
|
|
43
43
|
this.call.on("joined-meeting", () => {
|
|
44
|
-
this.emit("call-
|
|
44
|
+
this.emit("call-start");
|
|
45
45
|
});
|
|
46
46
|
this.call.on("left-meeting", () => {
|
|
47
|
-
this.emit("call-
|
|
47
|
+
this.emit("call-end");
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
await this.call.join({ url });
|