Next-auth: How to add more data to session

I’m using next v13.2.4 and next-auth v4.21.1. I was able to add more data to the client session by updating /pages/api/auth/[…nextauth.js] using the callbacks option. (It did not add more data to the server session). Here's an example [...nextauth.js] showing the addition of userId to the client session: import NextAuth from "next-auth"; export const authOptions … Continue reading Next-auth: How to add more data to session

Next-auth error: Property ‘session’ does not exist on type ‘Session’.

I was getting the error: "Property 'session' does not exist on type 'Session'." I'm using next v13.2.4 and next-auth v4.21.1. I couldn't find anything on this on Google! It turns out I had made a mistake in /pages/api/auth/[…nextauth.js]. This is my before code: export const authOptions = { // … callbacks: { session: async (session) … Continue reading Next-auth error: Property ‘session’ does not exist on type ‘Session’.