Going further
Adapt and deploy
Replace the fictional company and understand the shared-password boundary before hosting.
Keep the first adaptation small. Replace one department with your own example content, run a few real questions, and check that people can find the right source page.
Give your agent context
Read AGENTS.md and README.md. Explain the content flow before editing.
Replace the fictional Marketing department with our sample processes.
Keep pages short, give each one an owner and review date, and preserve
working internal links. Use the currently selected content source.Company branding lives in components/brand.tsx, app/page.tsx, and app/global.css. Department names live in lib/company.ts; the allowed Studio values live in sanity/schema.ts.
Keep published page paths stable. A renamed path needs its links updated too. In Sanity mode, add and publish content in Studio; the import does not overwrite existing pages.
Understand the password
proxy.ts checks a signed cookie before serving the homepage, docs, search, or chat API. Entering the shared password creates a seven-day HttpOnly cookie. Changing SITE_PASSWORD invalidates existing cookies.
This is enough for a small demonstration, but it does not identify individual employees or give departments different permissions. It also does not provide distributed rate limiting. Real private company information needs an access design appropriate to the organization.
Keep the Sanity dataset private. A password on the website cannot prevent someone from querying a public dataset directly.
Prepare for hosting
npm test
npm run check
npm run build
npm run studio:buildFor a later Vercel deployment, import your Git repository and keep the detected Next.js settings. Copy the server environment variables into the hosting settings, set a long unique site password, and use a Viewer token for SANITY_API_KEY. Keep the Developer token used for setup and importing out of the deployed app.
The website needs a server for the password gate, search, and chat routes, so do not use static export. Studio can run locally or at the hosted URL from the Sanity lesson. If the hosted editor requests access, add its exact origin to Sanity's CORS settings with credentials enabled.
Hosting the handbook website is optional. A GitHub repository stores your code, hosted Studio provides an editor, and a Next.js host runs the website. These are separate steps. Review the current Sanity quotas before opening access to more users.
Final checkpoint
Test with a fresh browser session. Direct docs URLs, /api/search, and /api/chat should require the password. After entering it, check that a published edit and a semantic search both work. If chat is enabled, ask a follow-up question and open its source link.