voxeet / voxeet-sdk-web

The Dolby.io Communications SDK for Web.
https://www.npmjs.com/package/@voxeet/voxeet-web-sdk
Other
4 stars 2 forks source link

Voxeet does not work with Next.Js #6

Closed nkdhamelia closed 2 years ago

nkdhamelia commented 2 years ago

Hi, I am trying to use Voxeet in my brand new Nextjs project but I am getting the following error, Is there any recommended way to integrate SDK with nextjs project? Please advice

voxeet

FabienLavocat commented 2 years ago

Working with our support team on this issue

FabienLavocat commented 2 years ago

I'm going to post the solution here.

Please make sure that you will load the Voxeet SDK in your NextJs app client side only. Something like this:

if(typeof window !== 'undefined') {
    const VoxeetSDK = require('@voxeet/voxeet-web-sdk');
    const init = VoxeetSDK.initializeToken.bind(VoxeetSDK);
    init(accessToken, refreshToken);
}