↑ ↓ navigate↵ selectesc close
✏️ Blog PostSanity

Sanity.io to Builder.io Data Transfer

CodingCat.dev tutorial cover image
✏️ Visual Architecture Diagram

how this post connects together.

Follow AJ from first principles to production-ready architecture.

✏️ Visual Diagram: Sanity.io to Builder.io Data Transfer
✓ Good PatternVISUAL DIAGRAM
Visual Diagram: Sanity.io to Builder.io Data TransferVisual architectural diagram showing: Step 1: Sanity.io to Builder.i (Mental model & why it matters) -> Step 2: Hands-On Implementation (Under the hood & live code) -> Step 3: Ship It Purrfectly (✓ Production trade-offs). Step-by-step diagram breakdown for Sanity.io to Builder.io Data Transfer: start with Sanity.io to Builder.i, implement Hands-On Implementation, and ship to production.✓Step 01Sanity.io to Builder.iMental model & why it matters✓Step 02Hands-On ImplementationUnder the hood & live code✓Step 03Ship It Purrfectly✓ Production trade-offsunroll the yarn✓ production ready
[Diagram Walkthrough]Step-by-step diagram breakdown for Sanity.io to Builder.io Data Transfer: start with Sanity.io to Builder.i, implement Hands-On Implementation, and ship to production.
AAA Contrast Verified

I am hoping to make a Sanity.io plugin for builder. In doing so I thought I would write a little conversion tool before hand to figure out all the ins and outs of Builder.io and Sanity.io, so I thought I would share some of my findings. I will keep this tutorial updated as the plugin progresses.

The repo example has three things that you might find useful.

  • Deleting All Data
  • Creating all new types
  • Adding all new Data

Repo for conversion example https://github.com/CodingCatDev/sanity-to-builder.git

Deleting All Data

https://github.com/CodingCatDev/sanity-to-builder/blob/84d8b5d436b2d674f916670317cb48de916c8a68/src/index.ts#L175

In order to delete all the data you need to first find all the models you want to delete

Get all Models from Builder (even unpublished)

In sanity you deal with things like draft. in documents. In Builder these items are just known to be unpublished version. So you need to have includeUnpublished=true in your API call. I looked for a while in the sdk and have not found this option so far.

You can handle this by using the fetch command instead of the sdk.

https://github.com/CodingCatDev/sanity-to-builder/blob/84d8b5d436b2d674f916670317cb48de916c8a68/src/config.ts#L134

Creating all new types

First you need to find all the types in your sanity.io database. I find it best to use Groq. So we can find all the types in Sanity and then create those in Builder as new Models.

Adding all new Data

Long Term goal

The End goal is to build a plugin for syncing your data...

Builder content link https://github.com/BuilderIO/builder/tree/main/plugins/contentful

Resources, Links & Official Documentation

Related CodingCat.dev Tutorials & Podcast Episodes

  • Sanity Knowledge Bases: Eliminate query-time guessing in your AI agents. Learn how Sanity Context Knowledge Bases compile structured datasets, crawled documentation websites, and uploa...
  • Using No-Code with Builder - Part 2: Alex and Brittney sit down with Steve Sewell, Co-Founder and CEO of http://builder.io/, to understand how http://builder.io/ is different from other no-code sol...
  • Using No-Code with Builder - Part 1: In this first part Alex sits down with Steve Sewell to understand how http://builder.io/ is different from other no-code solutions.

Frequently Asked Questions (FAQ)

What are the main takeaways from Sanity.io to Builder.io Data Transfer?

In this example I will walk you through what data looks like in Sanity.io and how to get that data over to your Builder.io instance while creating models. Sanity.io to Builder.io Data Transfer explores practical patterns for Sanity, Builder.io, GitHub in modern software engineering. Throughout this post, Alex Patterson breaks down real-world implementation details for Sanity, Builder.io, GitHub so developers can apply these patterns directly in production.

How do you implement Sanity best practices in production?

When adopting Sanity and Builder.io in a production stack, start by validating your configuration against the Sanity.io Content Operating System Docs (GROQ queries, Portable Text, Content Lake, and Agent Context). Focus on incremental adoption, automated testing, and observability so your team can measure performance and developer velocity improvements at each stage.

Where can I watch the full Sanity.io to Builder.io Data Transfer walkthrough and find related code resources?

You can explore the complete write-up and code examples right here on CodingCat.dev, and subscribe to the CodingCat.dev YouTube channel for weekly video tutorials. For a deeper dive into Sanity, check out our related guide: Sanity Knowledge Bases.