Hi! I wanted to add Growthbook via unpkg script in a SPA (Nextjs). I know I can just npm install the package but this is the requirement I currently need to work with. Trying to understand what best practice here would be
1. User navigates to a page with growthbook. Growthbook gets loaded client-side.
2. User then navigates to a page without growthbook. Since its a SPA, Growthbook variables will still be in memory.
The more general question is: are there any good ways to cleanly load and unload client-side scripts for single page apps?
07/05/2022, 7:49 PM
Are you able to hook into the React code at all or does it need to just be a
tag in the html template?
07/05/2022, 7:59 PM
Needs to be a
Is this possible?
07/05/2022, 8:03 PM
It should be possible to load the SDK like that. How are you planning to use it in your app though? Do you want to do something like
inside a React component and have it use the globally loaded instance from the script tag?
07/05/2022, 9:36 PM
Ah @future-teacher-7046 we just pushed back and were able to go with react implementation. Thanks for the time