@todesktop/plugin-recall 1.0.4 → 1.2.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 +86 -43
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,11 @@ This plugin provides a complete integration between ToDesktop and the Recall.ai
|
|
|
14
14
|
- **Upload progress tracking** and webhook integration
|
|
15
15
|
- **Type-safe client library** for web applications
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Want a tutorial?
|
|
18
|
+
|
|
19
|
+
Check out the [tutorial](https://todesktop.com/docs/tutorials/recall-transcripts) for a step-by-step guide on how to use the Recall desktop plugin and client SDK.
|
|
20
|
+
|
|
21
|
+
## Installation & Setup
|
|
18
22
|
|
|
19
23
|
### Prerequisites
|
|
20
24
|
|
|
@@ -52,35 +56,53 @@ import { recallDesktop } from "@todesktop/client-recall";
|
|
|
52
56
|
await recallDesktop.initSdk();
|
|
53
57
|
|
|
54
58
|
// Listen for meeting detection
|
|
55
|
-
recallDesktop.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
const stopMeetingListener = recallDesktop.addEventListener(
|
|
60
|
+
"meeting-detected",
|
|
61
|
+
async ({ window }) => {
|
|
62
|
+
console.log("Meeting detected:", window);
|
|
63
|
+
|
|
64
|
+
// Get upload token from your backend
|
|
65
|
+
const uploadToken = await getUploadTokenFromBackend();
|
|
66
|
+
|
|
67
|
+
// Start recording
|
|
68
|
+
const result = await recallDesktop.startRecording(window.id, uploadToken);
|
|
69
|
+
if (result.success) {
|
|
70
|
+
console.log("Recording started successfully");
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
|
-
|
|
73
|
+
);
|
|
67
74
|
|
|
68
75
|
// Listen for recording events
|
|
69
|
-
recallDesktop.
|
|
70
|
-
|
|
71
|
-
})
|
|
76
|
+
const stopStateListener = recallDesktop.addEventListener(
|
|
77
|
+
"sdk-state-change",
|
|
78
|
+
({ sdk }) => {
|
|
79
|
+
console.log("Recording state:", sdk.state.code);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
72
82
|
|
|
73
|
-
recallDesktop.
|
|
74
|
-
|
|
75
|
-
})
|
|
83
|
+
const stopUploadListener = recallDesktop.addEventListener(
|
|
84
|
+
"upload-progress",
|
|
85
|
+
({ progress }) => {
|
|
86
|
+
console.log(`Upload progress: ${progress}%`);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
76
89
|
|
|
77
90
|
// Handle recording completion
|
|
78
|
-
recallDesktop.
|
|
79
|
-
|
|
91
|
+
const stopRecordingListener = recallDesktop.addEventListener(
|
|
92
|
+
"recording-ended",
|
|
93
|
+
async ({ window }) => {
|
|
94
|
+
console.log("Recording ended for window:", window.id);
|
|
80
95
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
96
|
+
// Upload the recording
|
|
97
|
+
await recallDesktop.uploadRecording(window.id);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// Later, remove listeners when no longer needed
|
|
102
|
+
stopMeetingListener();
|
|
103
|
+
stopStateListener();
|
|
104
|
+
stopUploadListener();
|
|
105
|
+
stopRecordingListener();
|
|
84
106
|
```
|
|
85
107
|
|
|
86
108
|
### Desktop Audio Recording
|
|
@@ -112,13 +134,36 @@ console.log("Permissions:", status.permissions);
|
|
|
112
134
|
await recallDesktop.requestPermission("screen-capture");
|
|
113
135
|
|
|
114
136
|
// Listen for permission changes
|
|
115
|
-
recallDesktop.
|
|
116
|
-
|
|
117
|
-
})
|
|
137
|
+
const removePermissionListener = recallDesktop.addEventListener(
|
|
138
|
+
"permission-status",
|
|
139
|
+
({ permission, status }) => {
|
|
140
|
+
console.log(`Permission ${permission}: ${status}`);
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
// Remove the listener when you no longer need updates
|
|
145
|
+
removePermissionListener();
|
|
118
146
|
```
|
|
119
147
|
|
|
120
148
|
## Backend Integration
|
|
121
149
|
|
|
150
|
+
### Demo Backend Service
|
|
151
|
+
|
|
152
|
+
A minimal Express backend lives in `packages/backend` for demos. It exposes:
|
|
153
|
+
|
|
154
|
+
- `POST /api/create-sdk-upload` – calls the Recall API and returns `{ id, upload_token, recording_id }`
|
|
155
|
+
- `POST /webhooks/recall` – logs Recall webhook payloads for inspection
|
|
156
|
+
- `GET /health` – health check
|
|
157
|
+
|
|
158
|
+
Run it with your Recall token (replace the example value with the token for your workspace):
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
RECALL_API_TOKEN="c5a6aaff378e5dc5a7e28b3e2853eff832ce4bde" \
|
|
162
|
+
npm start --workspace=packages/backend
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The server defaults to `https://us-west-2.recall.ai`; override via `RECALL_API_BASE` if you use another region. Set `CORS_ORIGIN` to restrict cross-origin access (defaults to `*`).
|
|
166
|
+
|
|
122
167
|
### Creating Upload Tokens
|
|
123
168
|
|
|
124
169
|
Your backend needs to create upload tokens using the Recall.ai API:
|
|
@@ -191,13 +236,13 @@ app.post("/webhooks/recall", (req, res) => {
|
|
|
191
236
|
|
|
192
237
|
### Event Listeners
|
|
193
238
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
- `
|
|
197
|
-
- `
|
|
198
|
-
- `
|
|
199
|
-
- `
|
|
200
|
-
- `
|
|
239
|
+
Use `recallDesktop.addEventListener(eventType, callback)` to subscribe. Available event types include:
|
|
240
|
+
|
|
241
|
+
- `meeting-detected`, `meeting-updated`, `meeting-closed`
|
|
242
|
+
- `recording-started`, `recording-ended`, `sdk-state-change`
|
|
243
|
+
- `upload-progress`, `realtime-event`, `error`
|
|
244
|
+
- `permissions-granted`, `permission-status`
|
|
245
|
+
- `media-capture-status`, `participant-capture-status`, `shutdown`
|
|
201
246
|
|
|
202
247
|
### Configuration
|
|
203
248
|
|
|
@@ -217,16 +262,14 @@ app.post("/webhooks/recall", (req, res) => {
|
|
|
217
262
|
|
|
218
263
|
### Plugin Development
|
|
219
264
|
|
|
220
|
-
The plugin uses
|
|
265
|
+
- The Electron plugin uses `@recallai/desktop-sdk` directly; no mock setup is required.
|
|
266
|
+
- Before building or type-checking the client package, the `sync-sdk-types` script copies the SDK's TypeScript declarations into `packages/client/src/generated`. This runs automatically via `npm run build --workspace=@todesktop/client-recall` and `npm run typecheck --workspace=@todesktop/client-recall`, but you can invoke it manually with:
|
|
221
267
|
|
|
222
|
-
|
|
268
|
+
```bash
|
|
269
|
+
npm run sync-sdk-types --workspace=@todesktop/client-recall
|
|
270
|
+
```
|
|
223
271
|
|
|
224
|
-
|
|
225
|
-
npm install @recallai/desktop-sdk --workspace=packages/plugin
|
|
226
|
-
```
|
|
272
|
+
## Changelog
|
|
227
273
|
|
|
228
|
-
2.
|
|
229
|
-
|
|
230
|
-
// Replace mock with real import
|
|
231
|
-
import RecallAiSdk from "@recallai/desktop-sdk";
|
|
232
|
-
```
|
|
274
|
+
- 1.2.0
|
|
275
|
+
- Updated `@recallai/desktop-sdk` to v1.3.5
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todesktop/plugin-recall",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "ToDesktop plugin for Recall.ai Desktop Recording SDK - Plugin package",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"rimraf": "^5.0.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@recallai/desktop-sdk": "1.
|
|
68
|
+
"@recallai/desktop-sdk": "1.3.5",
|
|
69
69
|
"@types/node": "20.19.2"
|
|
70
70
|
}
|
|
71
71
|
}
|