Just trying to understand the implementation. Rega...
# support-questions-legacy
i
Just trying to understand the implementation. Regarding the
Session
imported from
"supertokens-node/recipe/session"
for the NodeJS package... the TS types say that
Session.getSession
returns
Promise<Session.SessionContainer | undefined>
. I thought that an error was thrown whenever a
session
isn't found by
getSession
. Is there ever a case where
session
is
undefined
and no error is thrown?
r
Hey! Yea. It’s possible if you give an option to the getSession function which allows for optional sessions
i
Okay so it's conditional. That makes more sense. Thanks!