# Problem with using Amity in NextJS project

**URL:** <https://forum.social.plus/t/problem-with-using-amity-in-nextjs-project/855>\
**Category:** Web\
**Created:** [July 31, 2023, 4:25am UTC](https://forum.social.plus/t/problem-with-using-amity-in-nextjs-project/855 "2023-07-31T04:25:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinhpna](https://avatars.discourse-cdn.com/v4/letter/v/48db29/32.png) [@vinhpna](https://forum.social.plus/u/vinhpna)\
**Post date:** [July 31, 2023, 4:25am UTC](https://forum.social.plus/t/problem-with-using-amity-in-nextjs-project/855/1 "2023-07-31T04:25:51Z")

</div>

Hi,  
I am using NextJS to build project with Amity ts-sdk.  
The problem is when I refresh a page or move to a new page I got below error.  
(I logged in at previous page).

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/5b4c274cdf20c5f4e8157e196e15a722966ff01e.png)  
Amity SDK using: `@amityco/ts-sdk": "^6.5.0"`  
Is there any way to fix this problem without logging in again in new page.  
Hope you reply soon.  
Have a nice day!

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [August 3, 2023, 3:50am UTC](https://forum.social.plus/t/problem-with-using-amity-in-nextjs-project/855/3 "2023-08-03T03:50:53Z")

</div>

@vinhpna Our SDK will loss session if the page is refresh. Therefore, you can solve by moving to new page without refresh or auto-login the session again when the page is refresh

Thank you,  
Amity Support
