getAccessToken requires req and res parameters

I am trying to get access token with the help of getAccessToken method as mentioned here in the @auth0/nextjs-auth0 documents. It shows as if there is no need to pass the req and res parameters when using in a “page” or “React Server Component” but without req and res parameters it does not work. Could you clarify this matter? Is it really possible to use getAccessToken method without passing req and res parameters as in the documents? If so, how?

Hey there @mbas welcome to the community!

I’m not super familiar with the nextjs-auth0 SDK but it looks you should be able to call getAccessToken with no args:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.