Convert any bespoke marketing website (Next.js / Astro) into a client-editable platform managed directly from Velo Dashboard, delivered in sub-50ms via Sanity Content Lake.
Headlines, paragraphs, CTA buttons (text + link destination), banner images (with alt text), and downloadable PDFs.
Page <title>, meta descriptions, OpenGraph share preview cards, and search indexing toggles.
Company name, phone, WhatsApp, email, office address, social links, announcement banner, and auto-generated Schema JSON-LD.
Dead-simple list cards for FAQs, client reviews, metric stats, and feature cards with + Add Item.
The frontend code must always fall back to the existing hardcoded strings and local image paths. If Sanity is empty, offline, or on fresh developer clones, the site continues to render 100% cleanly without broken UI or missing text.
Install @sanity/client and create lib/velo-content.ts in the client website:
import { createClient } from '@sanity/client';
const VELO_API_URL = process.env.NEXT_PUBLIC_VELO_URL || 'https://velo.baseworks.in';
const ORG_KEY = process.env.NEXT_PUBLIC_VELO_ORG_KEY;
export async function getVeloContent() {
try {
// Dynamic resolution via Velo Gateway
const res = await fetch(`${VELO_API_URL}/api/public/site-config?key=${ORG_KEY}`, {
next: { revalidate: 3600 },
});
const { config } = await res.json();
if (!config?.sanity_project_id) return { content: {}, seo: {}, businessProfile: {}, lists: {} };
const client = createClient({
projectId: config.sanity_project_id,
dataset: config.sanity_dataset || 'production',
apiVersion: '2024-05-15',
useCdn: true,
});
const doc = await client.fetch('*[_id == "siteContent"][0]');
if (!doc) return { content: {}, seo: {}, businessProfile: {}, lists: {} };
const content: Record<string, any> = {};
for (const [k, v] of Object.entries(doc.content || {})) {
content[k] = v;
content[k.replace(/__/g, '.')] = v;
}
const lists: Record<string, any[]> = {};
for (const [k, v] of Object.entries(doc.lists || {})) {
lists[k] = v;
lists[k.replace(/__/g, '.')] = v;
}
return { content, seo: doc.seo || {}, businessProfile: doc.businessProfile || {}, lists };
} catch {
return { content: {}, seo: {}, businessProfile: {}, lists: {} };
}
}In Server Components (e.g. app/page.tsx), render live values with code defaults:
import { getVeloContent } from '@/lib/velo-content';
export default async function Page() {
const { content, lists } = await getVeloContent();
return (
<main>
<h1>{content['home.hero.title'] ?? 'Default Code Headline'}</h1>
<p>{content['home.hero.subtitle'] ?? 'Default subtitle text.'}</p>
<a href={content['home.hero.cta']?.href ?? '/contact'}>
{content['home.hero.cta']?.label ?? 'Get Started'}
</a>
</main>
);
}Create scripts/velo-sync.ts with the field inventory and run it once to populate the Velo Cockpit:
const res = await fetch('https://velo.baseworks.in/api/webhooks/site-sync', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-org-key': process.env.NEXT_PUBLIC_VELO_ORG_KEY!,
},
body: JSON.stringify({
inventory: [
{ key: 'home.hero.title', label: 'Main Headline', page: 'Home', section: 'Hero', type: 'text', defaultValue: 'Default Headline' },
{ key: 'home.hero.cta', label: 'CTA Button', page: 'Home', section: 'Hero', type: 'button', defaultValue: { label: 'Get Started', href: '/contact' } },
]
}),
});Hand this prompt to Claude Code, Antigravity, or Cursor to convert any existing marketing website automatically: