diff --git a/packages/client/src/coordinator/connection/types.ts b/packages/client/src/coordinator/connection/types.ts index 99d46b0e43..ae4ccff12f 100644 --- a/packages/client/src/coordinator/connection/types.ts +++ b/packages/client/src/coordinator/connection/types.ts @@ -5,9 +5,9 @@ import { ConnectedEvent, UserRequest, VideoEvent } from '../../gen/coordinator'; export type UR = Record; export type User = - | (UserRequest & { type?: 'authenticated' }) - | (UserRequest & { type: 'guest' }) - | (Omit & { + | (Omit & { type?: 'authenticated' }) + | (Omit & { type: 'guest' }) + | (Omit & { id?: '!anon'; type: 'anonymous'; }); diff --git a/sample-apps/react/livestream-app/src/hooks/useInitVideoClient.ts b/sample-apps/react/livestream-app/src/hooks/useInitVideoClient.ts index c63aa730d0..55cd2b39be 100644 --- a/sample-apps/react/livestream-app/src/hooks/useInitVideoClient.ts +++ b/sample-apps/react/livestream-app/src/hooks/useInitVideoClient.ts @@ -10,12 +10,10 @@ const tokenProviderUrl = import.meta.env.VITE_TOKEN_PROVIDER_URL as string; type VideoClientProviderProps = { isAnon?: boolean; - role?: string; }; export const useInitVideoClient = ({ isAnon, - role, }: PropsWithChildren) => { const { callId } = useParams<{ callId: string }>(); const { api_key, token, type } = getURLCredentials(); @@ -48,7 +46,7 @@ export const useInitVideoClient = ({ apiKey, ...((isAnon || !token) && { tokenProvider }), ...(!isAnon && { token }), - user: isAnon ? { type: 'anonymous' } : role ? { ...user, role } : user, + user: isAnon ? { type: 'anonymous' } : user, }); setClient(_client); diff --git a/sample-apps/react/livestream-app/src/hosts/Hosts.tsx b/sample-apps/react/livestream-app/src/hosts/Hosts.tsx index 7bd3a7c118..09a757bd1a 100644 --- a/sample-apps/react/livestream-app/src/hosts/Hosts.tsx +++ b/sample-apps/react/livestream-app/src/hosts/Hosts.tsx @@ -3,7 +3,7 @@ import { Outlet } from 'react-router-dom'; import { useInitVideoClient } from '../hooks/useInitVideoClient'; export const Hosts = () => { - const client = useInitVideoClient({ role: 'host' }); + const client = useInitVideoClient({}); if (!client) { return null; diff --git a/sample-apps/react/livestream-app/src/viewers/Viewers.tsx b/sample-apps/react/livestream-app/src/viewers/Viewers.tsx index dcadb17e57..771fe5f866 100644 --- a/sample-apps/react/livestream-app/src/viewers/Viewers.tsx +++ b/sample-apps/react/livestream-app/src/viewers/Viewers.tsx @@ -12,7 +12,7 @@ import { ErrorPanel, LoadingPanel } from '../LoadingState'; export const Viewers = () => { const { callId } = useParams<{ callId?: string }>(); - const client = useInitVideoClient({ role: 'user' }); + const client = useInitVideoClient({}); if (!client) { return null; diff --git a/sample-apps/react/react-video-demo/src/components/LobbyPanel/LobbyPanel.data.ts b/sample-apps/react/react-video-demo/src/components/LobbyPanel/LobbyPanel.data.ts index e403c04251..fbb1c732a0 100644 --- a/sample-apps/react/react-video-demo/src/components/LobbyPanel/LobbyPanel.data.ts +++ b/sample-apps/react/react-video-demo/src/components/LobbyPanel/LobbyPanel.data.ts @@ -5,7 +5,6 @@ export const KichinSink: Props = { user: { id: '123213', name: 'Kichin Sink', - role: 'role', teams: ['team'], image: '', }, diff --git a/sample-apps/react/react-video-demo/src/components/Views/LobbyView/LobbyView.data.ts b/sample-apps/react/react-video-demo/src/components/Views/LobbyView/LobbyView.data.ts index 9ce6ac3ba8..80b60be6f4 100644 --- a/sample-apps/react/react-video-demo/src/components/Views/LobbyView/LobbyView.data.ts +++ b/sample-apps/react/react-video-demo/src/components/Views/LobbyView/LobbyView.data.ts @@ -4,7 +4,6 @@ export const KichinSink: Props = { user: { id: '123213', name: 'Kichin Sink', - role: 'role', teams: ['team'], image: '', },