Load Script after NextAuth session available
Unanswered
American Crocodile posted this in #help-forum
American CrocodileOP
I am loading an external Pendo script that depends on session user data for initialization. Using the
Is there a way to check for session before loading the Script? Or to set a timeout before loading the script?
This is in my main
strategy="afterInteractive"
, I am still having issues with the session not being available when the script initializes, so the user data is null. Is there a way to check for session before loading the Script? Or to set a timeout before loading the script?
This is in my main
layout.tsx
which is a server component.2 Replies
Yi Lon Ma
extract the logic to render the script into another component and use the
useSession
hookthen render conditionally