Video SDK Token Getting Undefined

150 views Asked by At

i was working on video SDK for react and i was getting the error: "Token is invalid" statusCode: 401 when the video SDK is hitting the api https://api.videosdk.live/infra/v1/meetings/init-config . when i cross-checked, i found that there is no authorization token inside the headers moreover this api is built in video SDK and i have no access to the add the token to it.

i was setting the token in the meeting provider, but still it was not adding token into the api call,

const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcGlrZXkiOiJlYTE4YTI5Yy0xNDMzLTRlYTktYTkzZS00MTdmNzhmZTAyMzMiLCJwZXJtaXNzaW9ucyI6WyJhbGxvd19qb2luIl0sImlhdCI6MTcwMTE1NTA3MSwiZXhwIjoxODU4OTQzMDcxfQ.sHQ4OBsq_e31vECXqx1H165-v70Wtu95hRGoeJYjpKU"
let meetingConfig = {
      meetingId: roomId,
      micEnabled: true,
      webcamEnabled: true,
      multiStream: true,
      name: '',
    }

  return (
          <MeetingProvider 
            config={meetingConfig} 
            token={token} 
          >
             <MeetingContainer
                updateMeetingLeftFlag={updateMeetingLeftFlag}
             />
          </MeetingProvider>  
        )

But here is the thing when i run the react app in Strict mode, the first time api call is getting failed due to absence of token, but the second time it was adding the token and api call is getting succeeded.

i am not sure what make this weird behaviour, but any help would be appreciated.

Here is my deployed firebase deployed url that we can check, once we hit on create meeting, in the network tab the init-config api fails

https://good-game-67b7e.web.app/

0

There are 0 answers