I'm trying to fetch the current user in Sanity CMS.
I found this code snippet which demonstrates use of userStore
But I don't understand how I can configure my project to accept this module lookup
import userStore from 'part:@sanity/base/user';
It throws an import error Cannot find module 'part:@sanity/base/user'
. Which makes sense as its a non standard node module.
- How can I resolve this so the module is found?
- Or alternatively anyone know another way to fetch the current user?
Inspecting that @sanity
source I can see base/lib/datastores
which has a userStore
it's just not obvious how to consume this.