Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the web-react and mobile-react-native example apps to use the new useSandbox({ sandboxApiUrl }) flat-prop API, enabling sandbox API URL overrides via query params (web) and Expo public env vars (mobile).
Changes:
- Pass
sandboxApiUrlintouseSandbox(...)across multiple web and mobile examples. - Add
SANDBOX_API_URLconstants for web examples (query param?sandboxApiUrl=→VITE_SANDBOX_API_URL→""). - Replace legacy
configOverride: { sandboxApiUrl: ... }usage in React Native examples with the new flat option shape and env var name.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| web-react/text-chat/src/App.tsx | Adds SANDBOX_API_URL resolution and passes it into useSandbox. |
| web-react/livestreaming/src/lib/consts.ts | Exports SANDBOX_API_URL constant sourced from query/env. |
| web-react/livestreaming/src/components/LivestreamViewer.tsx | Passes SANDBOX_API_URL into useSandbox for viewer token creation. |
| web-react/livestreaming/src/components/LivestreamStreamer.tsx | Passes SANDBOX_API_URL into useSandbox for livestream token creation. |
| web-react/fishjam-chat/src/lib/consts.ts | Exports SANDBOX_API_URL constant sourced from query/env. |
| web-react/fishjam-chat/src/components/JoinRoomCard.tsx | Passes SANDBOX_API_URL into useSandbox for peer token creation. |
| web-react/audio-only/src/JoinRoomForm.tsx | Adds SANDBOX_API_URL resolution and passes it into useSandbox. |
| mobile-react-native/video-player/components/FishjamPlayerViewer.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for viewer tokens. |
| mobile-react-native/video-player/components/FishjamPlayerStreamer.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for streamer tokens. |
| mobile-react-native/text-chat/hooks/useConnectFishjam.ts | Passes Expo env-driven sandboxApiUrl into useSandbox for peer tokens. |
| mobile-react-native/minimal-react-native/hooks/useConnectFishjam.ts | Migrates from configOverride to flat sandboxApiUrl option. |
| mobile-react-native/fishjam-chat/app/room/preview.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for peer tokens. |
| mobile-react-native/fishjam-chat/app/livestream/viewer.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for viewer tokens. |
| mobile-react-native/fishjam-chat/app/livestream/streamer.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for streamer tokens. |
| mobile-react-native/fishjam-chat/app/livestream/screen-sharing.tsx | Passes Expo env-driven sandboxApiUrl into useSandbox for screen-share livestream tokens. |
| mobile-react-native/blur-example/hooks/useConnectFishjam.ts | Migrates from configOverride and old env var to flat sandboxApiUrl option + new env var name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+12
| const SANDBOX_API_URL = | ||
| new URLSearchParams(window.location.search).get("sandboxApiUrl") ?? | ||
| import.meta.env.VITE_SANDBOX_API_URL ?? | ||
| ""; | ||
|
|
Comment on lines
+5
to
+8
| const SANDBOX_API_URL = | ||
| new URLSearchParams(window.location.search).get("sandboxApiUrl") ?? | ||
| import.meta.env.VITE_SANDBOX_API_URL ?? | ||
| ""; |
Comment on lines
+5
to
+8
| export const SANDBOX_API_URL = | ||
| new URLSearchParams(window.location.search).get("sandboxApiUrl") ?? | ||
| import.meta.env.VITE_SANDBOX_API_URL ?? | ||
| ""; |
| configOverride: { | ||
| sandboxApiUrl: process.env.EXPO_PUBLIC_FISHJAM_URL, | ||
| }, | ||
| sandboxApiUrl: process.env.EXPO_PUBLIC_SANDBOX_API_URL ?? '', |
Comment on lines
15
to
18
| const { leaveRoom, joinRoom } = useConnection(); | ||
| const { getSandboxPeerToken } = useSandbox({ | ||
| configOverride: { | ||
| sandboxApiUrl: process.env.EXPO_PUBLIC_FISHJAM_URL, | ||
| }, | ||
| sandboxApiUrl: process.env.EXPO_PUBLIC_SANDBOX_API_URL ?? '', | ||
| }); |
|
|
||
| export const FishjamPlayerViewer = ({ roomName }: { roomName: string }) => { | ||
| const { getSandboxViewerToken } = useSandbox(); | ||
| const { getSandboxViewerToken } = useSandbox({ |
| const navigation = useNavigation<NavigationProp<RootStackParamList>>(); | ||
| const { leaveRoom, joinRoom } = useConnection(); | ||
| const { getSandboxPeerToken } = useSandbox(); | ||
| const { getSandboxPeerToken } = useSandbox({ |
|
|
||
| const { getSandboxPeerToken } = useSandbox(); | ||
| const { getSandboxPeerToken } = useSandbox({ | ||
| sandboxApiUrl: process.env.EXPO_PUBLIC_SANDBOX_API_URL ?? '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sandboxApiUrltouseSandboxacross web-react and mobile-react-native examples, matching the new flat-prop API:useSandbox({ sandboxApiUrl }).?sandboxApiUrl=query param first, thenVITE_SANDBOX_API_URL, then empty string — mirroring the existingDEFAULT_FISHJAM_IDpattern.EXPO_PUBLIC_SANDBOX_API_URL.configOverride: { sandboxApiUrl: EXPO_PUBLIC_FISHJAM_URL }shape inblur-exampleandminimal-react-nativewith the new flat shape + new env var name.