{"slug": "i-turned-sanity-into-a-social-content-operating-system-that-publishes-to", "title": "I Turned Sanity Into a Social Content Operating System That Publishes to Instagram", "summary": "A developer built Sanity Social, a social content operating system for agencies that runs as a Sanity App SDK application inside the Sanity Dashboard and manages the full lifecycle of social content — client brand guidelines, campaigns, AI-assisted drafting, editorial review, approval, scheduling and publishing. The system uses Sanity Workflows and Functions to orchestrate an Idea → Draft → Internal Review → Client Review → Approved → Instagram pipeline, with AI caption drafts and an assistant powered by Sanity Content Agent that read structured brand and campaign context but never approve or publish. The developer connected a real Instagram Business account via Meta OAuth and successfully published an approved post from the app directly to Instagram, with secrets confined to a small Next.js backend.", "body_md": "*This is a submission for the [Sanity Challenge, Path Two: Vibe-Code Something Strange](https://dev.to/challenges/sanity-2026-09-16)*\n\nI built Sanity Social, a social content operating system for agencies.\n\nInstead of using Sanity only as a CMS, I used it to manage the complete lifecycle of social content: client brand guidelines, campaigns, AI-assisted drafting, editorial review, approval, scheduling, and finally publishing directly to Instagram.\n\nA post moves through:\n\nIdea → Draft → Internal Review → Client Review → Approved → Instagram\n\nThe final version isn't a mock integration. I connected a real Instagram Business account through Meta OAuth and successfully published an approved post from the Sanity application directly to Instagram.\n\nAn agency workspace for planning, approving, scheduling and publishing social content, built as a\n[Sanity App SDK](https://www.sanity.io/docs/app-sdk) application. It runs inside the Sanity\nDashboard, uses Sanity UI and the Content Lake for all content and workflow state, and publishes to\nInstagram through a small Next.js backend that is the only place secrets live.\n\nSanity models the whole editorial process here, not just the posts: client → brand guidelines →\ncampaign → social post → review workflow ([Sanity Workflows](https://www.sanity.io/docs/workflows))\n→ human approval → publishing to Instagram, orchestrated by Sanity Functions. AI caption drafts and\nan assistant run on [Sanity Content Agent](https://www.sanity.io/docs/content-agent) and read the\nstructured brand and campaign context. AI never approves or publishes anything.\n\nBuilt for the DEV + Sanity Challenge 2026, Path Two (\"Vibe-Code Something Strange\"), with Claude Code.\n\n| Sanity project | `8btwn23g` , dataset`production` | \n| App (Sanity Dashboard) | \"Social Studio\" App SDK | \n\nI built the project with Claude Code, using it as an implementation partner rather than a one-shot code generator.\n\nThe initial idea was simple: turn Sanity into a social content operating system for agencies, with structured client data, brand guidelines, campaigns, review states, AI-assisted drafting, and Instagram publishing.\n\nOne early direction was to turn the whole project into a full multi-tenant SaaS with custom authentication, tenant provisioning and Supabase RLS. That architecture still makes sense commercially, but it was too large for the challenge and distracted from the most interesting Sanity features.\n\nSo I changed direction and focused on a deeper Sanity-native experience using App SDK, Workflows, structured content and external API publishing.\n\nThe final editorial flow became:\n\nIdea → Draft → Internal Review → Client Review → Approved → Instagram\n\nClaude Code helped implement the custom App SDK interface, schemas, workflow synchronization, Instagram OAuth, encrypted token storage, publishing validation, duplicate-publish protection, AI drafting and tests.\n\nWhere things got interesting\n\nNot everything worked on the first attempt.\n\nThe Content Agent integration looked correct locally but failed against the real API until I deployed the required Studio and fixed issues that only appeared in production.\n\nInstagram was the biggest reality check. Mock publishing worked, but I wanted the submission to prove a real end-to-end flow. That meant configuring Meta OAuth, Instagram professional account access, Supabase, secure token storage and the deployed backend.\n\nAt one point the Sanity App reported “Backend unavailable” even though the backend health endpoint was fully healthy. That led to another debugging pass around the frontend/backend connection instead of assuming the deployment itself was broken.\n\nThe final test was real: I connected the @1367.studio Instagram Business account and successfully published an approved post from Social Studio directly to Instagram.\n\nAI and structured content\n\nI also wanted the AI feature to use Sanity for more than simple storage.\n\n“Draft with AI” reads structured context including:\n\nSanity Project ID: 8btwn23g\n\nDataset: production\n\nThe project uses structured documents for:\n\nSanity schemas:", "url": "https://wpnews.pro/news/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to", "canonical_source": "https://dev.to/leandrobarbosafr/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to-instagram-b97", "published_at": "2026-09-28 16:04:28+00:00", "updated_at": "2026-09-28 16:21:40.935523+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "generative-ai"], "entities": ["Sanity", "Instagram", "Meta", "Claude Code", "Sanity App SDK", "Sanity Content Agent", "Next.js", "Supabase"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to", "markdown": "https://wpnews.pro/news/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to.md", "text": "https://wpnews.pro/news/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to.txt", "jsonld": "https://wpnews.pro/news/i-turned-sanity-into-a-social-content-operating-system-that-publishes-to.jsonld"}}