diff --git a/packages/realtime_client/lib/src/realtime_channel.dart b/packages/realtime_client/lib/src/realtime_channel.dart index fe7b4ca8..8ca989b4 100644 --- a/packages/realtime_client/lib/src/realtime_channel.dart +++ b/packages/realtime_client/lib/src/realtime_channel.dart @@ -491,7 +491,8 @@ class RealtimeChannel { if (!canPush && type == RealtimeListenTypes.broadcast) { final headers = { 'Content-Type': 'application/json', - 'apikey': socket.params['apikey'] ?? '', + if (socket.params['apikey'] != null) + 'apikey': socket.params['apikey']!, ...socket.headers, 'Authorization': socket.accessToken != null ? 'Bearer ${socket.accessToken}' : '',