
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see the issue! You're using the wrong npm package. The astro-sanity package you have in your config is an unofficial/older community package, but Sanity has an official integration called @sanity/astro that you should be using instead.
Here's what you need to do:
npm uninstall astro-sanity
npm install @sanity/astroimport { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import svelte from '@astrojs/svelte';
import sanity from '@sanity/astro'; // Changed this line
import react from '@astrojs/react';
import netlify from "@astrojs/netlify/functions";
export default defineConfig({
output: 'hybrid',
integrations: [
tailwind(),
svelte(),
sanity({
projectId: '<actualProjectID>',
dataset: 'production',
useCdn: false,
studioBasePath: '/admin'
}),
react()
],
adapter: netlify()
});Make sure your admin folder contains a proper Sanity Studio setup with:
sanity.config.ts (or .js) fileThe official Astro documentation shows the correct setup process. The @sanity/astro package is the maintained, official integration that properly handles embedding the Studio at a custom path like /admin.
The 404 error you're experiencing is likely because astro-sanity doesn't have the same Studio embedding capabilities as the official @sanity/astro package. After switching packages, your /admin route should work correctly!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content backend


The only platform powering content operations


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store