Is there any chance a function could be added that...
# support-questions
i
Is there any chance a function could be added that returns the session found on the server instead of (or in addition to) adding it to the
request
object? (Talking about
Node.js
here.) I'm playing around with
Svelte Kit
. And it seems like they don't give us access to any data tacked onto the request object. I'm trying to figure out if there's a more functional way to get the session instead. 🤔
r
Hey @ITEnthusiasm
i
Ah that does seem nice. Looking at the
Caution
warning, is there anything particularly disadvantageous about using this approach? Is it less safe? Or is it simply less easy to use?
> > Directory import 'C:\Users\thoma\repos\svelte-kit-supertokens\node_modules\supertokens-node\recipe\session' is not supported resolving ES modules imported from C:\Users\thoma\repos\svelte-kit-supertokens\.svelte-kit\output\server\chunks\hooks-d65b2dc8.js > > Did you mean to import supertokens-node/recipe/session/index.js? Does
Session
support ES Modules?
r
You need to use commonJs imports
Also, it’s just less easy to use. No other disadvantage
i
I see. Okay, thanks for the clarity. Right now my app requires ES Modules so I'll have to find a workaround. Thanks again
13 Views