diff --git a/src/getstream.js b/src/getstream.js
index <HASH>..<HASH> 100644
--- a/src/getstream.js
+++ b/src/getstream.js
@@ -26,7 +26,7 @@ function connect(apiKey, apiSecret, appId, options) {
    * @example <caption>where streamURL looks like</caption>
    * "https://thierry:pass@gestream.io/?app=1"
    */
-  if (typeof process !== 'undefined' && process.env.STREAM_URL && !apiKey) {
+  if (process && process.env && process.env.STREAM_URL && !apiKey) {
     const parts = /https:\/\/(\w+):(\w+)@([\w-]*).*\?app_id=(\d+)/.exec(process.env.STREAM_URL);
     apiKey = parts[1];
     apiSecret = parts[2];
fixes #<I> with undefined process.env