Skip to content

FCE-3216 Update examples to use sandbox api url#68

Open
czerwiukk wants to merge 1 commit into
mainfrom
FCE-3216
Open

FCE-3216 Update examples to use sandbox api url#68
czerwiukk wants to merge 1 commit into
mainfrom
FCE-3216

Conversation

@czerwiukk
Copy link
Copy Markdown
Member

  • Pass sandboxApiUrl to useSandbox across web-react and mobile-react-native examples, matching the new flat-prop API: useSandbox({ sandboxApiUrl }).
  • Web examples read the URL from ?sandboxApiUrl= query param first, then VITE_SANDBOX_API_URL, then empty string — mirroring the existing DEFAULT_FISHJAM_ID pattern.
  • Mobile examples read from EXPO_PUBLIC_SANDBOX_API_URL.
  • Replaced the old configOverride: { sandboxApiUrl: EXPO_PUBLIC_FISHJAM_URL } shape in blur-example and minimal-react-native with the new flat shape + new env var name.

Copilot AI review requested due to automatic review settings May 11, 2026 14:05
@linear
Copy link
Copy Markdown

linear Bot commented May 11, 2026

FCE-3216

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moq-demo Ready Ready Preview, Comment May 11, 2026 2:05pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sandboxApiUrl into useSandbox(...) across multiple web and mobile examples.
  • Add SANDBOX_API_URL constants 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 ?? '',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants