Hey there, I'm using supertokens-web-js in a Next.js project and after running bundle analyzer I can see that supertokens-website is a dependency, which appears to contain a fetch.js (I assume it's a fetch polyfill), axios.js, and other related modules that I would rather not include in the bundle. Is this expected, and if so would there be any scope in the future for passing in a fetch function when initialising supertokens?
r
rp_st
03/23/2023, 2:20 AM
Hey @bobs_ramen those aren’t polyfills. They r interceptors that we add to fetch and axios for session management to work.
b
bobs_ramen
03/23/2023, 3:52 AM
@rp_st Ah ok, thanks for getting back to me. Adding supertokens increased our initial js bundle by about 22% so I was hoping it able to be trimmed down a bit but I guess we just have to deal with it 😄 We love the library btw!
r
rp_st
03/23/2023, 6:07 AM
Thanks! How much was the original bundle size btw?
b
bobs_ramen
03/23/2023, 6:31 PM
My original calculation was off but my app bundle went from 67.87 -> 91.06 gzipped. sound about right?
r
rp_st
03/23/2023, 6:34 PM
yea, that makes sense. Our web-js SDK does add that much (depending on which recipe is being used)
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).