Build process is failing with anonymous user error

Hey folks. I was trying out this awesome tool and created a basic fold. Now I wanted to get access to the JSON structure of the page so that I can be easily integrated into the next.js project. I followed the doc. But the build process is failing at this Error: Anonymous User tried to get project PROJECT_ID, but their access level blocked didn't meet required level viewer. Really confused as to what I’m missing here. The studio is working properly though. Thanks!

Hey @dry_felidae,
You need to provide Project Access Token to initPlasmicLoader call. Please note that Project Access Token is different than Personal access token.

You can get the Project token by clicking on the Code button on the top right corner considering you have opened the project.

If you get stuck, let me know if you need a sample demo video for it.

@zonal_mammal I’m just using project token in initPlasmicLoader to run the studio, but the same is not working when I need to fetch plasmic data. Is a personal token required in that case?

personal access token is created after executing plasmic auth command. It then authorize Plasmic using the browser and stores the access token locally in our file system. It’s used to authorize the plasmic command such as plasmic sync

Can you please share the code snippet?

below is the snippet.

Hey @dry_felidae,
I think you have mistakenly copied the double quote " at the end of the token.

oohh, man. This is funny now. Thanks @zonal_mammal for figuring it out. It’s working now. I guess need a fresh pair of eyes on this. We should have a copy button here too for better UX.