Skip to content

Commit

Permalink
fix: accept api key from url params (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz committed Apr 5, 2024
1 parent 3a6dbc9 commit 9428a76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions social-messenger-ts/src/index.tsx
Expand Up @@ -16,11 +16,12 @@ if (process.env.NODE_ENV === 'production') {
});
}

const apiKey = process.env.REACT_APP_STREAM_KEY;
const urlParams = new URLSearchParams(window.location.search);
const apiKey = urlParams.get('api_key') || process.env.REACT_APP_STREAM_KEY;
const user = urlParams.get('user') || process.env.REACT_APP_USER_ID;
const userToken = urlParams.get('user_token') || process.env.REACT_APP_USER_TOKEN;
const targetOrigin = urlParams.get('target_origin') || process.env.REACT_APP_TARGET_ORIGIN as string;
const targetOrigin =
urlParams.get('target_origin') || (process.env.REACT_APP_TARGET_ORIGIN as string);

const noChannelNameFilter = urlParams.get('no_channel_name_filter') || true;
const skipNameImageSet = urlParams.get('skip_name_image_set') || false;
Expand Down

0 comments on commit 9428a76

Please sign in to comment.