You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to integrate the web sdk into a nextjs app but the snippet from the docs already throws syntax errors.
I've also tried integrating with the npm package but when I try to init then I get a window is not defined error even though I'm initializing in a useEffect hook. Any clues as to what's happening?
The text was updated successfully, but these errors were encountered:
useEffect(()=>{asyncfunctioninitAndFetch(){constBranchSDK=(awaitimport('branch-sdk')).defaultBranchSDK.init(process.env.NEXT_PUBLIC_BRANCH_KEY!)BranchSDK.data(function(err,data){if(err){console.warn(`Branch failed to resolve link: ${err}`)return}// do something with `data`?})}initAndFetch()},[])
Trying to integrate the web sdk into a nextjs app but the snippet from the docs already throws syntax errors.
I've also tried integrating with the npm package but when I try to init then I get a
window is not defined
error even though I'm initializing in auseEffect
hook. Any clues as to what's happening?The text was updated successfully, but these errors were encountered: