Does the nextjs-auth0 package work with the NextJS 13 experimental app directory?
The documentation and examples for using nextjs-auth0 for NextJS 12.x using the _app.ts file are very clear and straight forward and I have that working as expected. What’s the correct way to implement nextjs-auth0 in NextJS 13.x? I tried moving the wrapper element to a root layout.ts or template.ts file and even leaving it in _app.ts, but trying to use the useUser() hook from within a page in the /app directory results in an error about useUser() not being a function.
I can’t seem to find any code examples for how to use nextjs-auth0 with the app directory. Any help appreciated.
I think this will become quite important to auth0. The nextjs-auth0 package is a nice community effort, but I do not think they are a relevant blocker or decision maker. The nextjs app dir and server rendered components could possibly be treated simply like any server API. We would want auth0 to take a closer look and put out recommendations or examples on how to build against nextjs 13 app dir.
For those who still keep landing here, this feature will be added in v3 of the Auth0 NextJS npm package. You can follow the v3 development progress in this github issue. They are aiming to release by the end of July.