Next.js Discord

Discord Forum

Embedded sanity project in Nextjs

Answered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
If anyone has worked with this recently. How do I deploy sanity schemas when sanity is embedded? sanity deploy does not work
Answered by Asian black bear
you do not use sanity deploy with embedded or self-hosted projects, it is only for their free/built-in hosting
View full answer

10 Replies

Asian black bear
you do not use sanity deploy with embedded or self-hosted projects, it is only for their free/built-in hosting
Answer
Asian black bear
basically you just navigate to the route where the embedded version is and it just works
@Asian black bear you do not use `sanity deploy` with embedded or self-hosted projects, it is only for their free/built-in hosting
Cape lionOP
oh! that is amazing! thank you 😊 is there anything I need to install to get the visionTool() cause embeded version does not have that. And when I try to add it to the config file it complains that the package doesn't exist... 😅
Asian black bear
you need to install it in your Next project, like if you use npm npm install --save @sanity/vision
then this will work in sanity.config.js import {visionTool} from '@sanity/vision'
Dwarf Hotot
Hi @Cape lion!
After you have deployed your next app with Sanity embedded, are you able to to visit Sanity Studio endpoint?
Dwarf Hotot
const config = defineConfig({
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID as string,
  dataset: process.env.NEXT_PUBLIC_SANITY_DATASET as string,
  title: 'testing-1',
  apiVersion: '2023-09-13',
  basePath: '/admin',
  plugins: [deskTool(), visionTool()],
  schema: { types: schemas },
});
export default config;
The endpoint I mean is thebasePath`
Are you able to start you Studio when you go to your basePath on your deployed version ?
Sun bear
im interested in this post