Difference between useSession and getSession in next-auth?

Viewed 1508

What's the difference between useSession and getSession in next-auth? Both seems to be returning session object.

1 Answers

useSession ReactJS hook that works only on client, that returns states which helps you to update UI and it's made on top of getSession

getSession thenable function (returns promise) that read current cookies and returns session, works both on Client and Server

Related