@todesktop/plugin-recall 1.0.1
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 +271 -0
- package/dist/main.d.ts +23 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +694 -0
- package/dist/main.js.map +1 -0
- package/dist/preload.d.ts +136 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +218 -0
- package/dist/preload.js.map +1 -0
- package/dist/shared.d.ts +139 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +35 -0
- package/dist/shared.js.map +1 -0
- package/dist/store.d.ts +128 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +231 -0
- package/dist/store.js.map +1 -0
- package/package.json +71 -0
- package/src/main.ts +474 -0
- package/src/preload.ts +237 -0
- package/src/shared.ts +204 -0
- package/src/store.ts +266 -0
- package/tsconfig.json +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# ToDesktop Recall Desktop SDK Plugin
|
|
2
|
+
|
|
3
|
+
A ToDesktop plugin that integrates with [Recall.ai's Desktop Recording SDK](https://docs.recall.ai/docs/desktop-sdk) to enable automatic meeting recording for Zoom, Google Meet, and Microsoft Teams.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This plugin provides a complete integration between ToDesktop and the Recall.ai Desktop Recording SDK, offering:
|
|
8
|
+
|
|
9
|
+
- **Automatic meeting detection** for Zoom, Google Meet, Microsoft Teams, and Slack
|
|
10
|
+
- **Recording management** with start, stop, pause, and resume functionality
|
|
11
|
+
- **Desktop audio recording** for non-meeting scenarios
|
|
12
|
+
- **Real-time events** including transcription and participant data
|
|
13
|
+
- **Permission management** for accessibility, screen capture, and microphone access
|
|
14
|
+
- **Upload progress tracking** and webhook integration
|
|
15
|
+
- **Type-safe client library** for web applications
|
|
16
|
+
|
|
17
|
+
## Installation &s Setup
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
|
|
21
|
+
1. **Recall.ai Account**: Sign up at [recall.ai](https://recall.ai) and get your API key
|
|
22
|
+
2. **ToDesktop Builder App**: Create a ToDesktop application
|
|
23
|
+
3. **Backend Integration**: Set up webhook endpoints and upload token generation
|
|
24
|
+
|
|
25
|
+
### 1. Install Dependencies
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @todesktop/client-recall
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Add Plugin to ToDesktop Builder
|
|
32
|
+
|
|
33
|
+
1. Open ToDesktop Builder
|
|
34
|
+
2. Install the recall desktop sdk plugin
|
|
35
|
+
|
|
36
|
+
### 4. Configure Plugin Preferences
|
|
37
|
+
|
|
38
|
+
In ToDesktop Builder, configure the following preferences:
|
|
39
|
+
|
|
40
|
+
- **API URL**: Your Recall.ai region URL (e.g., `https://us-east-1.recall.ai`)
|
|
41
|
+
- **Enable Plugin**: Toggle to enable/disable recording functionality
|
|
42
|
+
- **Request permissions on startup**: Automatically request required permissions
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Basic Recording Workflow
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { recallDesktop } from "@todesktop/client-recall";
|
|
50
|
+
|
|
51
|
+
// Initialize the SDK
|
|
52
|
+
await recallDesktop.initSdk();
|
|
53
|
+
|
|
54
|
+
// Listen for meeting detection
|
|
55
|
+
recallDesktop.onMeetingDetected(async ({ window }) => {
|
|
56
|
+
console.log("Meeting detected:", window);
|
|
57
|
+
|
|
58
|
+
// Get upload token from your backend
|
|
59
|
+
const uploadToken = await getUploadTokenFromBackend();
|
|
60
|
+
|
|
61
|
+
// Start recording
|
|
62
|
+
const result = await recallDesktop.startRecording(window.id, uploadToken);
|
|
63
|
+
if (result.success) {
|
|
64
|
+
console.log("Recording started successfully");
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Listen for recording events
|
|
69
|
+
recallDesktop.onRecordingStateChange(({ sdk }) => {
|
|
70
|
+
console.log("Recording state:", sdk.state.code);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
recallDesktop.onUploadProgress(({ progress }) => {
|
|
74
|
+
console.log(`Upload progress: ${progress}%`);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// Handle recording completion
|
|
78
|
+
recallDesktop.onRecordingEnded(async ({ window }) => {
|
|
79
|
+
console.log("Recording ended for window:", window.id);
|
|
80
|
+
|
|
81
|
+
// Upload the recording
|
|
82
|
+
await recallDesktop.uploadRecording(window.id);
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Desktop Audio Recording
|
|
87
|
+
|
|
88
|
+
For capturing audio from applications other than supported meeting platforms:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// Prepare desktop audio recording
|
|
92
|
+
const { data } = await recallDesktop.prepareDesktopAudioRecording();
|
|
93
|
+
const { windowId } = data;
|
|
94
|
+
|
|
95
|
+
// Get upload token and start recording
|
|
96
|
+
const uploadToken = await getUploadTokenFromBackend();
|
|
97
|
+
await recallDesktop.startRecording(windowId, uploadToken);
|
|
98
|
+
|
|
99
|
+
// Stop when done
|
|
100
|
+
await recallDesktop.stopRecording(windowId);
|
|
101
|
+
await recallDesktop.uploadRecording(windowId);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Permission Management
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// Check permission status
|
|
108
|
+
const status = await recallDesktop.getStatus();
|
|
109
|
+
console.log("Permissions:", status.permissions);
|
|
110
|
+
|
|
111
|
+
// Request specific permission
|
|
112
|
+
await recallDesktop.requestPermission("screen-capture");
|
|
113
|
+
|
|
114
|
+
// Listen for permission changes
|
|
115
|
+
recallDesktop.onPermissionStatusChange(({ permission, status }) => {
|
|
116
|
+
console.log(`Permission ${permission}: ${status}`);
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Backend Integration
|
|
121
|
+
|
|
122
|
+
### Creating Upload Tokens
|
|
123
|
+
|
|
124
|
+
Your backend needs to create upload tokens using the Recall.ai API:
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
// Example backend endpoint
|
|
128
|
+
app.post("/api/create-upload-token", async (req, res) => {
|
|
129
|
+
const response = await fetch(`${RECALL_API_URL}/api/v1/sdk-upload/`, {
|
|
130
|
+
method: "POST",
|
|
131
|
+
headers: {
|
|
132
|
+
Authorization: `Token ${RECALL_API_KEY}`,
|
|
133
|
+
"Content-Type": "application/json",
|
|
134
|
+
},
|
|
135
|
+
body: JSON.stringify({
|
|
136
|
+
transcript: {
|
|
137
|
+
provider: {
|
|
138
|
+
assembly_ai_streaming: {},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const data = await response.json();
|
|
145
|
+
res.json({ uploadToken: data.upload_token });
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Webhook Handling
|
|
150
|
+
|
|
151
|
+
Set up webhooks to handle recording completion:
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
app.post("/webhooks/recall", (req, res) => {
|
|
155
|
+
const { event, data } = req.body;
|
|
156
|
+
|
|
157
|
+
switch (event) {
|
|
158
|
+
case "sdk_upload.complete":
|
|
159
|
+
console.log("Recording completed:", data.recording.id);
|
|
160
|
+
// Process completed recording
|
|
161
|
+
break;
|
|
162
|
+
|
|
163
|
+
case "sdk_upload.failed":
|
|
164
|
+
console.log("Recording failed:", data);
|
|
165
|
+
// Handle failure
|
|
166
|
+
break;
|
|
167
|
+
|
|
168
|
+
case "sdk_upload.uploading":
|
|
169
|
+
console.log("Recording uploading:", data);
|
|
170
|
+
// Track upload progress
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
res.status(200).send("OK");
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## API Reference
|
|
179
|
+
|
|
180
|
+
### Main Methods
|
|
181
|
+
|
|
182
|
+
- `initSdk()` - Initialize the Recall SDK
|
|
183
|
+
- `shutdownSdk()` - Shutdown the SDK and cleanup
|
|
184
|
+
- `getStatus()` - Get plugin and SDK status
|
|
185
|
+
- `startRecording(windowId, uploadToken)` - Start recording a meeting
|
|
186
|
+
- `stopRecording(windowId)` - Stop recording
|
|
187
|
+
- `pauseRecording(windowId)` - Pause recording
|
|
188
|
+
- `resumeRecording(windowId)` - Resume recording
|
|
189
|
+
- `uploadRecording(windowId)` - Upload completed recording
|
|
190
|
+
- `prepareDesktopAudioRecording()` - Prepare desktop audio capture
|
|
191
|
+
|
|
192
|
+
### Event Listeners
|
|
193
|
+
|
|
194
|
+
- `onMeetingDetected(callback)` - Meeting window detected
|
|
195
|
+
- `onRecordingStateChange(callback)` - Recording state changes
|
|
196
|
+
- `onRecordingStarted(callback)` - Recording started
|
|
197
|
+
- `onRecordingEnded(callback)` - Recording completed
|
|
198
|
+
- `onUploadProgress(callback)` - Upload progress updates
|
|
199
|
+
- `onError(callback)` - SDK errors
|
|
200
|
+
- `onPermissionStatusChange(callback)` - Permission changes
|
|
201
|
+
|
|
202
|
+
### Configuration
|
|
203
|
+
|
|
204
|
+
- `setConfig(config)` - Update plugin configuration
|
|
205
|
+
- `getConfig()` - Get current configuration
|
|
206
|
+
- `requestPermission(permission)` - Request specific permission
|
|
207
|
+
|
|
208
|
+
## Development
|
|
209
|
+
|
|
210
|
+
### Available Scripts
|
|
211
|
+
|
|
212
|
+
- `npm run build` - Build all packages
|
|
213
|
+
- `npm run dev` - Development mode with watch
|
|
214
|
+
- `npm run test` - Run tests
|
|
215
|
+
- `npm run typecheck` - TypeScript type checking
|
|
216
|
+
- `npm run clean` - Clean build artifacts
|
|
217
|
+
|
|
218
|
+
### Plugin Development
|
|
219
|
+
|
|
220
|
+
The plugin uses a mock Recall SDK implementation for development. To integrate with the real SDK:
|
|
221
|
+
|
|
222
|
+
1. Install the actual Recall SDK:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
npm install @recallai/desktop-sdk --workspace=packages/plugin
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
2. Replace the mock in `packages/plugin/src/main.ts`:
|
|
229
|
+
```typescript
|
|
230
|
+
// Replace mock with real import
|
|
231
|
+
import RecallAiSdk from "@recallai/desktop-sdk";
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Supported Platforms
|
|
235
|
+
|
|
236
|
+
- **Zoom**: Full meeting detection and recording
|
|
237
|
+
- **Google Meet**: Full meeting detection and recording
|
|
238
|
+
- **Microsoft Teams**: Full meeting detection and recording
|
|
239
|
+
- **Slack Huddles**: Audio capture (limited metadata)
|
|
240
|
+
- **Desktop Audio**: General audio capture for other applications
|
|
241
|
+
|
|
242
|
+
## Security & Privacy
|
|
243
|
+
|
|
244
|
+
- All recording operations require explicit user consent
|
|
245
|
+
- Plugin preferences control recording behavior
|
|
246
|
+
- Recordings are encrypted during upload
|
|
247
|
+
- Only authorized applications can access the recording APIs
|
|
248
|
+
- Meeting participants should be notified of recording as required by law
|
|
249
|
+
|
|
250
|
+
## Troubleshooting
|
|
251
|
+
|
|
252
|
+
### Common Issues
|
|
253
|
+
|
|
254
|
+
1. **Plugin not loading**: Verify plugin is properly configured in ToDesktop Builder
|
|
255
|
+
2. **Permissions denied**: Ensure all required permissions are granted in System Preferences
|
|
256
|
+
3. **SDK initialization fails**: Check API URL and network connectivity
|
|
257
|
+
4. **Recording fails**: Verify upload token is valid and backend is accessible
|
|
258
|
+
|
|
259
|
+
### Debug Mode
|
|
260
|
+
|
|
261
|
+
Enable debug logging by setting preferences or environment variables in your ToDesktop app.
|
|
262
|
+
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
MIT License - see LICENSE file for details.
|
|
266
|
+
|
|
267
|
+
## Support
|
|
268
|
+
|
|
269
|
+
- [Recall.ai Documentation](https://docs.recall.ai/docs/desktop-sdk-beta)
|
|
270
|
+
- [ToDesktop Plugin Documentation](https://docs.todesktop.com/plugins)
|
|
271
|
+
- [GitHub Issues](https://github.com/your-org/todesktop-recall/issues)
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToDesktop Recall Desktop SDK Plugin - Main Process
|
|
3
|
+
*
|
|
4
|
+
* This file runs in Electron's main process and handles:
|
|
5
|
+
* - Recall Desktop SDK integration and lifecycle management
|
|
6
|
+
* - IPC communication with renderer processes
|
|
7
|
+
* - Meeting detection and recording management
|
|
8
|
+
* - Event forwarding from SDK to frontend
|
|
9
|
+
*/
|
|
10
|
+
declare class RecallDesktopMain {
|
|
11
|
+
private version;
|
|
12
|
+
private isInitialized;
|
|
13
|
+
private subscriptions;
|
|
14
|
+
private trackedWebContents;
|
|
15
|
+
initialize(): Promise<void>;
|
|
16
|
+
private loadPreferences;
|
|
17
|
+
private initializeSdk;
|
|
18
|
+
private setupSdkEventListeners;
|
|
19
|
+
private registerIpcHandlers;
|
|
20
|
+
}
|
|
21
|
+
declare const recallDesktopMain: RecallDesktopMain;
|
|
22
|
+
export default recallDesktopMain;
|
|
23
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuDH,cAAM,iBAAiB;IACrB,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAA2D;IAChF,OAAO,CAAC,kBAAkB,CAA2C;IAE/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBjC,OAAO,CAAC,eAAe;YAYT,aAAa;IA0B3B,OAAO,CAAC,sBAAsB;IAoH9B,OAAO,CAAC,mBAAmB;CA2N5B;AAGD,QAAA,MAAM,iBAAiB,mBAA0B,CAAC;AAGlD,eAAe,iBAAiB,CAAC"}
|