@memberjunction/server 6.1.1 → 6.1.3

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 CHANGED
@@ -108,6 +108,7 @@ MJServer uses a layered configuration system with the following priority (highes
108
108
  | `MJ_REST_API_INCLUDE_ENTITIES` | Comma-separated entity include list | (optional) |
109
109
  | `MJ_REST_API_EXCLUDE_ENTITIES` | Comma-separated entity exclude list | (optional) |
110
110
  | `MJ_TELEMETRY_ENABLED` | Enable server telemetry | `true` |
111
+ | `MJ_REALTIME_ENABLED` | Enable WebRTC SDP broker router (`/realtime/sdp-exchange`) | `true` |
111
112
  | `METADATA_CACHE_REFRESH_INTERVAL` | Metadata refresh interval (ms) | `180000` |
112
113
  | `MJ_LOG_GRAPHQL_VARIABLES` | Enable redacted verbose echo of GraphQL variables to stdout — see [Debugging GraphQL requests](#debugging-graphql-requests) | `false` |
113
114
 
@@ -181,6 +182,12 @@ module.exports = {
181
182
  level: 'standard', // 'minimal' | 'standard' | 'verbose' | 'debug'
182
183
  },
183
184
 
185
+ // Realtime WebRTC SDP broker router (/realtime/sdp-exchange)
186
+ // Enabled by default; can be disabled via MJ_REALTIME_ENABLED=false or realtime.enabled: false
187
+ realtime: {
188
+ enabled: true,
189
+ },
190
+
184
191
  // Debugging — see "Debugging GraphQL requests" below
185
192
  loggingSettings: {
186
193
  graphql: {
@@ -249,6 +256,38 @@ export class MyInput {
249
256
  }
250
257
  ```
251
258
 
259
+ ### Realtime WebRTC Broker Configuration
260
+
261
+ MemberJunction provides a built-in WebRTC SDP broker router mounted at `/realtime/sdp-exchange`. This endpoint enables browser clients to negotiate full-duplex audio and data channels with realtime models (such as Gemini Live 3.8 and OpenAI Realtime) via proxy sessions.
262
+
263
+ #### Why Realtime is Enabled by Default
264
+
265
+ `realtime.enabled` defaults to `true`. This decision was made because:
266
+ 1. **Safe by Design**: The broker endpoint is protected by single-use ticket redemption via `RealtimeProxyRegistry`. Inbound requests cannot initiate or hijack sessions without an ephemeral ticket issued through an authenticated GraphQL session (`StartRealtimeClientSession`).
267
+ 2. **Zero-Friction Realtime UX**: Voice co-agents, live audio, and collaborative whiteboards work out of the box without requiring operators to discover and configure esoteric flags.
268
+
269
+ #### Disabling Realtime
270
+
271
+ Operators running an API server strictly as a headless GraphQL/REST backend without realtime media requirements can disable the broker route in either of two ways:
272
+
273
+ 1. **Environment Variable**:
274
+ ```bash
275
+ MJ_REALTIME_ENABLED=false
276
+ ```
277
+ 2. **`mj.config.cjs`**:
278
+ ```javascript
279
+ module.exports = {
280
+ // ...
281
+ realtime: {
282
+ enabled: false,
283
+ },
284
+ };
285
+ ```
286
+
287
+ When disabled, the `/realtime/sdp-exchange` Express route is not mounted, and incoming requests to that path return standard 404 responses.
288
+
289
+
290
+
252
291
  ## Usage
253
292
 
254
293
  ### Basic Server Setup