# NextJS 13 integration using the App Directory

**URL:** <https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, nextjs-auth0\
**Created:** [January 15, 2023, 1:28pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199 "2023-01-15T13:28:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![assafw](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/assafw/32/42671_2.png) [@assafw](https://community.auth0.com/u/assafw)\
**Post date:** [January 15, 2023, 1:28pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/1 "2023-01-15T13:28:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Domexx](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/domexx/32/42849_2.png) [@Domexx](https://community.auth0.com/u/Domexx)\
**Post date:** [January 20, 2023, 5:05pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/2 "2023-01-20T17:05:23Z")

</div>

I would also like to know this

---

<div class="post-metadata">

**Author:** ![bertrand.fovez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bertrand.fovez/32/33412_2.png) [@bertrand.fovez](https://community.auth0.com/u/bertrand.fovez)\
**Post date:** [January 22, 2023, 5:43pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/3 "2023-01-22T17:43:59Z")

</div>

I am very much interested too. A element of my choice between Next and Nuxt was indeed the existence of the Auth0-Next integration.

---

<div class="post-metadata">

**Author:** ![assafw](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/assafw/32/42671_2.png) [@assafw](https://community.auth0.com/u/assafw)\
**Post date:** [February 5, 2023, 4:30pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/4 "2023-02-05T16:30:56Z")

</div>

Looks like Auth0 support for NextJS 13 is still pending the official stable release of Next’s `app` directory. See this thread on the repo - [NextJS 13: support for server-side components in nextjs-auth0 · Issue #889 · auth0/nextjs-auth0 · GitHub](https://github.com/auth0/nextjs-auth0/issues/889)

---

<div class="post-metadata">

**Author:** ![dev47](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev47/32/33281_2.png) [@dev47](https://community.auth0.com/u/dev47)\
**Post date:** [March 22, 2023, 7:11pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/5 "2023-03-22T19:11:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![matt-cbi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matt-cbi/32/45995_2.png) [@matt-cbi](https://community.auth0.com/u/matt-cbi)\
**Post date:** [May 5, 2023, 9:09am UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/6 "2023-05-05T09:09:07Z")

</div>

The app directory is now in stable release as of Nextjs 13.4.0. When can we expect the Auth0 package to support the app directory?

---

<div class="post-metadata">

**Author:** ![matt-cbi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matt-cbi/32/45995_2.png) [@matt-cbi](https://community.auth0.com/u/matt-cbi)\
**Post date:** [July 25, 2023, 4:06pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/8 "2023-07-25T16:06:01Z")

</div>

For those who still keep landing here, this feature will be added in v3 of the [Auth0 NextJS npm package](https://www.npmjs.com/package/@auth0/nextjs-auth0). You can follow the v3 development progress in [this github issue](https://github.com/auth0/nextjs-auth0/issues/1235). They are aiming to release by the end of July.

---

<div class="post-metadata">

**Author:** ![matt-cbi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matt-cbi/32/45995_2.png) [@matt-cbi](https://community.auth0.com/u/matt-cbi)\
**Post date:** [July 28, 2023, 11:36am UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/9 "2023-07-28T11:36:58Z")

</div>

Support is now live in v3 of the [NPM package](https://www.npmjs.com/package/@auth0/nextjs-auth0) 👍

---

<div class="post-metadata">

**Author:** ![logan.vw](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@logan.vw](https://community.auth0.com/u/logan.vw)\
**Post date:** [July 28, 2023, 5:14pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/10 "2023-07-28T17:14:00Z")

</div>

Thank you for keeping us updated!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 16, 2024, 6:54pm UTC](https://community.auth0.com/t/nextjs-13-integration-using-the-app-directory/98199/11 "2024-05-16T18:54:26Z")

</div>

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