[Vuejs]-NuxtJS: How to access Vuex state on Server side

0👍

There is predefined method nuxtServerInit which you can use in your store to get user ID to vuex on server side before fetching data. https://hashinteractive.com/blog/using-nuxtserverinit-in-vuex-to-fetch-component-data/

Then you can retrieve it from the store in the fetch method. Nuxt 2.12.2: Filling the store with the new fetch method

Leave a comment