NextJS version 13.5.2
Zoom Video SDK: 1.10.7
When importing the zoom video with the following: import ZoomVideo from '@zoom/videosdk';
I am getting the error ReferenceError: navigator is not defined
Looking online it says something about react loading the zoom sdk before window is initialized and this makes it throws the error.
I can load the SDK with the following: const { default: ZoomVideo } = await import('@zoom/videosdk');
within a useEffect.
The problem is I do not want to have to load the ZoomSDK in a useEffect in every component I make. Some functions I want to live outside of a useEffect, where only the ZoomSDK is defined.
One solution I found was creating all the function definitions outside the useEffect then updating them after the ZoomSDK loads in the useEffect. Seems iffy to me though. Would rather a simpler solution.
Has anyone ran into this before?
Thanks