We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 339e955 + b9da036 commit cd8a925Copy full SHA for cd8a925
lib/api.js
@@ -63,11 +63,11 @@ export class RealtimeAPI extends RealtimeEventHandler {
63
if (this.isConnected()) {
64
throw new Error(`Already connected`);
65
}
66
- if (globalThis.document) {
+ if (globalThis.WebSocket) {
67
/**
68
* Web browser
69
*/
70
- if (this.apiKey) {
+ if (globalThis.document && this.apiKey) {
71
console.warn(
72
'Warning: Connecting using API key in the browser, this is not recommended',
73
);
0 commit comments