diff --git a/sample-apps/react-native/dogfood/babel.config.js b/sample-apps/react-native/dogfood/babel.config.js index 2d1e6fcbaf..6b3bb5fb2d 100644 --- a/sample-apps/react-native/dogfood/babel.config.js +++ b/sample-apps/react-native/dogfood/babel.config.js @@ -1,14 +1,4 @@ module.exports = { presets: ['@rnx-kit/babel-preset-metro-react-native'], - plugins: [ - 'react-native-reanimated/plugin', - [ - 'module:react-native-dotenv', - // Added for Chat SDK - { - moduleName: 'react-native-dotenv', - path: '.env', - }, - ], - ], + plugins: ['react-native-reanimated/plugin'], }; diff --git a/sample-apps/react-native/dogfood/config.js b/sample-apps/react-native/dogfood/config.js new file mode 100644 index 0000000000..cda77661ad --- /dev/null +++ b/sample-apps/react-native/dogfood/config.js @@ -0,0 +1 @@ +export const STREAM_API_KEY = 'hd8szvscpxvd'; diff --git a/sample-apps/react-native/dogfood/package.json b/sample-apps/react-native/dogfood/package.json index bdb2a3e873..8a40af884d 100644 --- a/sample-apps/react-native/dogfood/package.json +++ b/sample-apps/react-native/dogfood/package.json @@ -34,7 +34,6 @@ "react-native": "0.71.11", "react-native-callkeep": "4.3.11", "react-native-device-info": "^10.6.0", - "react-native-dotenv": "^3.4.7", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.12.0", "react-native-haptic-feedback": "^2.0.3", diff --git a/sample-apps/react-native/dogfood/src/components/ChatWrapper.tsx b/sample-apps/react-native/dogfood/src/components/ChatWrapper.tsx index 8916a09823..7f533eedca 100644 --- a/sample-apps/react-native/dogfood/src/components/ChatWrapper.tsx +++ b/sample-apps/react-native/dogfood/src/components/ChatWrapper.tsx @@ -3,10 +3,10 @@ import { Chat, OverlayProvider, Streami18n } from 'stream-chat-react-native'; import { useChatClient } from '../hooks/useChatClient'; import { AuthenticationProgress } from './AuthenticatingProgress'; import { StreamChatGenerics } from '../../types'; -import { STREAM_API_KEY } from 'react-native-dotenv'; import { useAppGlobalStoreValue } from '../contexts/AppContext'; import { createToken } from '../modules/helpers/createToken'; import { useStreamChatTheme } from '../hooks/useTheme'; +import { STREAM_API_KEY } from '../../config'; const streami18n = new Streami18n({ language: 'en', diff --git a/sample-apps/react-native/dogfood/src/components/VideoWrapper.tsx b/sample-apps/react-native/dogfood/src/components/VideoWrapper.tsx index 37ec9228e8..82c5e1532e 100644 --- a/sample-apps/react-native/dogfood/src/components/VideoWrapper.tsx +++ b/sample-apps/react-native/dogfood/src/components/VideoWrapper.tsx @@ -3,10 +3,10 @@ import { StreamVideo, StreamVideoClient, } from '@stream-io/video-react-native-sdk'; -import { STREAM_API_KEY } from 'react-native-dotenv'; import { useAppGlobalStoreValue } from '../contexts/AppContext'; import { createToken } from '../modules/helpers/createToken'; import translations from '../translations'; +import { STREAM_API_KEY } from '../../config'; export const VideoWrapper = ({ children }: PropsWithChildren<{}>) => { const userId = useAppGlobalStoreValue((store) => store.userId); diff --git a/sample-apps/react-native/dogfood/src/modules/helpers/createToken.ts b/sample-apps/react-native/dogfood/src/modules/helpers/createToken.ts index 183060f4ff..ac29da96c0 100644 --- a/sample-apps/react-native/dogfood/src/modules/helpers/createToken.ts +++ b/sample-apps/react-native/dogfood/src/modules/helpers/createToken.ts @@ -1,4 +1,4 @@ -import { STREAM_API_KEY } from 'react-native-dotenv'; +import { STREAM_API_KEY } from '../../../config'; type ParamsType = { user_id: string; diff --git a/sample-apps/react-native/dogfood/src/screens/Meeting/GuestMeetingScreen.tsx b/sample-apps/react-native/dogfood/src/screens/Meeting/GuestMeetingScreen.tsx index 15cc70da28..60b6eba7e7 100644 --- a/sample-apps/react-native/dogfood/src/screens/Meeting/GuestMeetingScreen.tsx +++ b/sample-apps/react-native/dogfood/src/screens/Meeting/GuestMeetingScreen.tsx @@ -10,6 +10,7 @@ import { import { MeetingStackParamList } from '../../../types'; import { MeetingUI } from '../../components/MeetingUI'; import { createToken } from '../../modules/helpers/createToken'; +import { STREAM_API_KEY } from '../../../config'; type Props = NativeStackScreenProps< MeetingStackParamList, @@ -20,7 +21,6 @@ export const GuestMeetingScreen = (props: Props) => { const [videoClient, setVideoClient] = useState( undefined, ); - const apiKey = process.env.STREAM_API_KEY as string; const { params: { guestUserId, callId, mode }, } = props.route; @@ -49,7 +49,7 @@ export const GuestMeetingScreen = (props: Props) => { useEffect(() => { const _videoClient = new StreamVideoClient({ - apiKey, + apiKey: STREAM_API_KEY, user: userToConnect, tokenProvider: mode === 'anonymous' ? tokenProvider : undefined, options: { logLevel: 'warn' }, @@ -60,7 +60,7 @@ export const GuestMeetingScreen = (props: Props) => { _videoClient?.disconnectUser(); setVideoClient(undefined); }; - }, [tokenProvider, userToConnect, apiKey, mode]); + }, [tokenProvider, userToConnect, mode]); const call = useMemo(() => { if (!videoClient) { diff --git a/sample-apps/react-native/dogfood/src/utils/setPushConfig.ts b/sample-apps/react-native/dogfood/src/utils/setPushConfig.ts index 8067866183..fa9a46cf67 100644 --- a/sample-apps/react-native/dogfood/src/utils/setPushConfig.ts +++ b/sample-apps/react-native/dogfood/src/utils/setPushConfig.ts @@ -3,10 +3,10 @@ import { StreamVideoRN, } from '@stream-io/video-react-native-sdk'; import { AndroidImportance } from '@notifee/react-native'; -import { STREAM_API_KEY } from 'react-native-dotenv'; import { staticNavigate } from './staticNavigationUtils'; import { mmkvStorage } from '../contexts/createStoreContext'; import { createToken } from '../modules/helpers/createToken'; +import { STREAM_API_KEY } from '../../config'; export function setPushConfig() { StreamVideoRN.setPushConfig({ diff --git a/yarn.lock b/yarn.lock index d996ac9655..74a5556410 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6870,7 +6870,6 @@ __metadata: react-native: 0.71.11 react-native-callkeep: 4.3.11 react-native-device-info: ^10.6.0 - react-native-dotenv: ^3.4.7 react-native-fs: ^2.20.0 react-native-gesture-handler: ^2.12.0 react-native-haptic-feedback: ^2.0.3 @@ -12557,7 +12556,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.0.3, dotenv@npm:^16.1.4, dotenv@npm:^16.3.1": +"dotenv@npm:^16.1.4, dotenv@npm:^16.3.1": version: 16.3.1 resolution: "dotenv@npm:16.3.1" checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd @@ -22852,17 +22851,6 @@ __metadata: languageName: node linkType: hard -"react-native-dotenv@npm:^3.4.7": - version: 3.4.8 - resolution: "react-native-dotenv@npm:3.4.8" - dependencies: - dotenv: ^16.0.3 - peerDependencies: - "@babel/runtime": ^7.20.6 - checksum: 8443cec44862d3e110f236b1120d8a1f829cb4545a85c8462e6c01935aa216f50b05eb659661db29939d4d293ce7de6212bf877963e3b37f6c900629f6546d67 - languageName: node - linkType: hard - "react-native-fs@npm:^2.20.0": version: 2.20.0 resolution: "react-native-fs@npm:2.20.0"