payload-socket-plugin 1.1.2 → 1.1.4
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 +15 -2
- package/dist/socketManager.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -357,14 +357,26 @@ This is handled automatically via the `"browser"` field in `package.json`, so yo
|
|
|
357
357
|
|
|
358
358
|
## Environment Variables
|
|
359
359
|
|
|
360
|
+
The plugin does not read environment variables directly. You can use environment variables in your configuration:
|
|
361
|
+
|
|
360
362
|
```bash
|
|
361
|
-
#
|
|
363
|
+
# Example: Redis URL for multi-instance support
|
|
362
364
|
REDIS_URL=redis://localhost:6379
|
|
363
365
|
|
|
364
366
|
# Optional: Payload configuration
|
|
365
367
|
PAYLOAD_SECRET=your-secret-key
|
|
366
368
|
```
|
|
367
369
|
|
|
370
|
+
Then pass them in your plugin configuration:
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
socketPlugin({
|
|
374
|
+
redis: {
|
|
375
|
+
url: process.env.REDIS_URL,
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
```
|
|
379
|
+
|
|
368
380
|
## TypeScript Types
|
|
369
381
|
|
|
370
382
|
```typescript
|
|
@@ -406,10 +418,11 @@ import type {
|
|
|
406
418
|
|
|
407
419
|
**Solutions**:
|
|
408
420
|
|
|
409
|
-
- Verify `
|
|
421
|
+
- Verify `redis.url` is set correctly in plugin options
|
|
410
422
|
- Check Redis server is running and accessible
|
|
411
423
|
- Ensure both server instances use the same Redis URL
|
|
412
424
|
- Check Redis logs for connection errors
|
|
425
|
+
- Make sure you're passing the Redis URL in the plugin configuration, not relying on environment variables
|
|
413
426
|
|
|
414
427
|
### TypeScript Errors
|
|
415
428
|
|
package/dist/socketManager.js
CHANGED
|
@@ -49,9 +49,9 @@ class SocketIOManager {
|
|
|
49
49
|
* Setup Redis adapter for multi-instance synchronization
|
|
50
50
|
*/
|
|
51
51
|
async setupRedisAdapter() {
|
|
52
|
-
const redisUrl =
|
|
52
|
+
const redisUrl = this.options.redis?.url;
|
|
53
53
|
if (!redisUrl) {
|
|
54
|
-
payload_1.default.logger.warn("
|
|
54
|
+
payload_1.default.logger.warn("Redis URL not configured. Skipping Redis adapter setup. Set redis.url in plugin options.");
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
try {
|