@droponair/sdk-js 0.19.0 → 0.22.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/CHANGELOG.md +38 -0
- package/README.md +55 -0
- package/dist/core/messaging-client.d.ts +3 -1
- package/dist/core/messaging-client.js +126 -90
- package/dist/core/types.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/transport/auto-select.d.ts +47 -0
- package/dist/transport/auto-select.js +64 -0
- package/dist/transport/messaging-transport.d.ts +33 -0
- package/dist/transport/messaging-transport.js +2 -0
- package/dist/transport/sse-messaging-transport.d.ts +28 -0
- package/dist/transport/sse-messaging-transport.js +59 -0
- package/dist/transport/webtransport-transport.d.ts +61 -0
- package/dist/transport/webtransport-transport.js +124 -0
- package/dist/transport/ws-messaging-transport.d.ts +24 -0
- package/dist/transport/ws-messaging-transport.js +67 -0
- package/dist/transport/wt-messaging-transport.d.ts +25 -0
- package/dist/transport/wt-messaging-transport.js +54 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,44 @@ This project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.22.0], 2026-05-25
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **MessagingClient transport selection.** `initialize({ transport: 'ws' | 'sse' | 'wt' | 'auto' })` lets your app choose the signaling lane at init time. Default stays `'ws'`, so existing integrations are byte-identical. `'auto'` queries `GET /api/info.transports` and picks the best available lane from what the runtime supports. WebSocket close-code semantics (1008 JWT-expiry surfacing, 4001 JWT-refresh-on-event) are preserved on the WebSocket path; SSE/WT synthesize close events.
|
|
14
|
+
- **MQTT (IoT) broadcast lane (4.5b).** Broadcasts now mirror to MQTT topic `droponair/v1/broadcast/{appId}/{channelId}` on `mqtts://mqtt.droponair.com:8883`. For IoT subscribers that consume your broadcasts without our full SDK. Subscribe-only, per-app credentials, TLS only. Visible via `GET /api/info` (`transports` includes `"mqtt"`, `features` includes `"transport_mqtt"`). No SDK API change, the lane is consumed directly by MQTT clients.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `MessagingClient` now uses an internal `MessagingTransport` adapter rather than a direct `WebSocket` reference. WebSocket remains the default; no protocol change. Adapters: `WebSocketMessagingTransport` (default), `SseMessagingTransport`, `WtMessagingTransport`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## [0.21.0], 2026-05-24
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **Transport auto-select helper (Phase 4.6).** New `selectTransport({ httpUrl })` reads `/api/info.transports`, intersects with the runtime's `WebTransport`/`WebSocket`/`EventSource` availability, and returns the best lane (preference: WebTransport -> WebSocket -> SSE; overridable via `preference`). Caller then constructs the corresponding primitive. Pluggable `fetchFn` for Node + tests.
|
|
27
|
+
|
|
28
|
+
### Notes
|
|
29
|
+
|
|
30
|
+
- Foundation for an `init({ transport: 'auto' })` shortcut once full `MessagingClient` integration lands (4.2.1b). Today it's a small standalone helper so existing customers can adopt the pattern without waiting.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## [0.20.0], 2026-05-24
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- **WebTransport (HTTP/3) transport primitive (Phase 4.3).** New `WebTransportTransport` class uses the browser-native `WebTransport` API to ride the platform's `/v1/transport/wt` HTTP/3 endpoint, terminated by the `droponair-webtransport` sidecar. Same shape as `SseTransport`: `onFrame`, `sendEnvelope`, `connect`, `close`. Caller brings own protobuf decoder. Browser-only for v1 (Chromium 97+, Firefox 125+, Safari TP-only); Node 22+ has experimental support behind flags.
|
|
39
|
+
|
|
40
|
+
### Notes
|
|
41
|
+
|
|
42
|
+
- WebTransport gives multi-stream perf wins over WebSocket on flaky cellular and similar networks. WebSocket on `/ws` remains the default; this primitive is opt-in for environments that have native WebTransport.
|
|
43
|
+
- The droponair.com endpoint only advertises `transports: ["webtransport"]` once the `droponair-webtransport` sidecar is up and `app.transport.webtransport-enabled` is flipped on sdk-be. Check `GET /api/info.transports` for the live list.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
9
47
|
## [0.19.0], 2026-05-24
|
|
10
48
|
|
|
11
49
|
### Added
|
package/README.md
CHANGED
|
@@ -397,6 +397,61 @@ await client.stopSfuRecording(room.roomId, rec.recordingId);
|
|
|
397
397
|
|
|
398
398
|
Completion lands as the `sfu-recording.completed` webhook (or by polling `listSfuRecordings`) and carries `locationUri` pointing at the finalized file in your bucket. E2EE-encrypted SFU rooms cannot be server-recorded by design (the media server forwards traffic it cannot decrypt) - use the client-side `startRecording` for those.
|
|
399
399
|
|
|
400
|
+
Live call participants also receive in-band notification frames via the existing group-call event callback so a "🔴 RECORDING" UI badge stays in sync. The event types are `GROUP_CALL_SFU_RECORDING_STARTED` (payload = recordingId), `GROUP_CALL_SFU_RECORDING_STOPPED` (recordingId), and `GROUP_CALL_SFU_RECORDING_AVAILABLE` (`recordingId|locationUri`); the platform also notifies late joiners about any already-active SFU recording on the room. Plan limits (`maxSfuRecordingMinutesPerMonth`) are enforced server-side; deny at `startSfuRecording` returns HTTP 403 with a deny reason such as `MONTHLY_SFU_RECORDING_MINUTES_LIMIT_REACHED`.
|
|
401
|
+
|
|
402
|
+
### HTTP fallback (SSE) transport
|
|
403
|
+
|
|
404
|
+
Available since SDK `0.19.0`. For environments where WebSocket upgrades are blocked by a corporate firewall but plain HTTPS GET/POST work, the SDK exports a standalone `SseTransport` primitive that rides the platform's `/v1/transport/stream` (long-lived SSE) and `/v1/transport/send` (POST) endpoints. WebSocket on `/ws` remains the default for `client.connect()`; this primitive is opt-in for the corporate-firewall use case.
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
import { SseTransport } from '@droponair/sdk-js';
|
|
408
|
+
|
|
409
|
+
const sse = new SseTransport({
|
|
410
|
+
httpUrl: 'https://sdk.droponair.com',
|
|
411
|
+
getJwt: async () => jwt,
|
|
412
|
+
});
|
|
413
|
+
sse.onFrame((bytes) => { /* protobuf decode */ });
|
|
414
|
+
await sse.connect();
|
|
415
|
+
await sse.sendEnvelope(envelopeBytes);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
EventSource-based receive (auto-reconnects + 25s keep-alives that defeat proxy idle timeouts), `fetch` POST for send. Bring your own protobuf decoder (use the codec already exported by the SDK). Verify the lane is enabled on the server via `GET /api/info`: the `transports` array includes `"sse"` and `features` includes `"transport_sse"`. v1 covers 1:1 Envelope delivery; call signaling stays on WebSocket. Full `init({ transport: 'sse' })` integration into `MessagingClient` lands in a follow-up.
|
|
419
|
+
|
|
420
|
+
### WebTransport (HTTP/3) transport
|
|
421
|
+
|
|
422
|
+
Available since SDK `0.20.0`. For modern browsers + environments with native HTTP/3 support, the SDK exports a `WebTransportTransport` primitive that rides the platform's `/v1/transport/wt` endpoint. Multi-stream and lower head-of-line blocking versus WebSocket; particularly useful on flaky cellular networks.
|
|
423
|
+
|
|
424
|
+
```typescript
|
|
425
|
+
import { WebTransportTransport } from '@droponair/sdk-js';
|
|
426
|
+
|
|
427
|
+
const wt = new WebTransportTransport({
|
|
428
|
+
httpUrl: 'https://sdk.droponair.com',
|
|
429
|
+
getJwt: async () => jwt,
|
|
430
|
+
});
|
|
431
|
+
wt.onFrame((bytes) => { /* protobuf decode */ });
|
|
432
|
+
await wt.connect();
|
|
433
|
+
await wt.sendEnvelope(envelopeBytes);
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Uses the browser-native `WebTransport` API; opens a single bidirectional stream and rides raw bytes both ways. Browser support: Chromium 97+ (stable), Firefox 125+ (stable), Safari Technology Preview only, Node 22+ behind experimental flags. The `droponair.com` endpoint advertises `transports: ["webtransport"]` only when the `droponair-webtransport` sidecar is live; check `GET /api/info.transports` and `features.transport_webtransport` to detect availability. Bring your own protobuf decoder. WebSocket remains the default; this primitive is purely opt-in.
|
|
437
|
+
|
|
438
|
+
### Transport auto-select
|
|
439
|
+
|
|
440
|
+
Available since SDK `0.21.0`. `selectTransport({ httpUrl })` queries `/api/info.transports`, intersects with what the runtime supports (`WebTransport` / `WebSocket` / `EventSource`), and returns the best lane for this client + platform pair. Default preference: WebTransport → WebSocket → SSE (overridable).
|
|
441
|
+
|
|
442
|
+
```typescript
|
|
443
|
+
import { selectTransport, WebTransportTransport, SseTransport } from '@droponair/sdk-js';
|
|
444
|
+
|
|
445
|
+
const lane = await selectTransport({ httpUrl: 'https://sdk.droponair.com' });
|
|
446
|
+
switch (lane) {
|
|
447
|
+
case 'webtransport': /* new WebTransportTransport(...) */ break;
|
|
448
|
+
case 'sse': /* new SseTransport(...) */ break;
|
|
449
|
+
default: /* fall through to your WebSocket client */
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Foundation for an `init({ transport: 'auto' })` shortcut once full `MessagingClient` integration lands (a follow-up). Today it's a small standalone helper so existing customers can adopt the pattern without waiting.
|
|
454
|
+
|
|
400
455
|
### Call Recording
|
|
401
456
|
|
|
402
457
|
Available since SDK `0.16.0`. The SDK **signals** recording state on a group or room call; your app does the actual media capture (`MediaRecorder`) and uploads the file to your own storage — the platform never holds the media. The recording signal is broadcast to every participant (including anyone who joins later); that transparency is enforced server-side.
|
|
@@ -14,7 +14,8 @@ export declare class MessagingClient implements DropOnAirClient {
|
|
|
14
14
|
private readonly fetchFn;
|
|
15
15
|
private readonly codec;
|
|
16
16
|
private attachmentClient;
|
|
17
|
-
private
|
|
17
|
+
private transport;
|
|
18
|
+
private resolvedTransportName;
|
|
18
19
|
private shouldReconnect;
|
|
19
20
|
private reconnectTimer;
|
|
20
21
|
private dropOnAirJwt;
|
|
@@ -324,6 +325,7 @@ export declare class MessagingClient implements DropOnAirClient {
|
|
|
324
325
|
private emitBroadcast;
|
|
325
326
|
private handleIncomingGroupMessage;
|
|
326
327
|
private emitGroupCallEvent;
|
|
328
|
+
private resolveTransport;
|
|
327
329
|
private connectWebSocket;
|
|
328
330
|
private handleIncomingMessageEdit;
|
|
329
331
|
private handleIncomingMessageDelete;
|