N
Nuxt3y ago
TOMOLAI

How to access useStrapi from server api folder?

I wish to use a composable (useStrapi from @Nuxtjs/strapi), but I get an error. Anyone have any idea on how I can do it?
2 Replies
TOMOLAI
TOMOLAIOP3y ago
So it appears that you are unable to do this, and you would have to use $fetch.
K1nggor
K1nggor3y ago
composables can only be used in setup functions or script setup. If you want to call strapi you will need to use something else and maybe implement the strapi client core package : https://www.npmjs.com/package/strapi-client-core. In your server utils

Did you find this page helpful?