inference bureau
Answers from our docs and articlesesc to close
Try asking
Create an accountSign up

Leaving Gadget, part 1: the import, start to finish on a real app

We ran the Gadget import on a real booking app: 78 files in, 21 files and a 53-line to-do list out. What converts by itself, what the report asks of you, and how long each part takes.

Key takeaways

  • ggt pull writes your Gadget app's files to a folder, and the import turns them into an Inference Bureau app: schemas with their storage keys, the actions that have code of their own, settings from the triggers, and permissions.
  • On a real Shopify booking app, 78 files became 21. Eight action files were left out on purpose, because they only did what the platform does with no file at all.
  • GADGET_IMPORT.md lists what's left, file by file and line by line: 29 code notes, 9 about Shopify, 5 HTTP routes, 4 schema notes, 3 actions, 2 settings and the frontend. A skill beside it teaches your coding agent the same mapping.
  • The code notes are mechanical and an agent clears most of them in an afternoon. The frontend and the HTTP routes are the real work, and the report tells you where each one goes.

Gadget shuts down on March 31, 2027. Coming from Gadget covers what maps to what and what you'll rewrite. This series is the move itself, one part at a time, on real apps. Part 1 is the import: what you get back when you hand it a Gadget app, and what the report it writes asks you to do.

The app in this part is a real one: a booking app for a Shopify store, with time slots, capacity that follows orders, a theme app extension for the booking widget, and a handful of HTTP routes the widget calls. It's a typical mid-sized Gadget app, and we're not naming it. The numbers are its.

Step 1: pull it

Gadget's CLI writes an app's files the way the import wants them. In an empty folder:

mkdir booking && cd booking
npx ggt pull --app=<your-app> --env=development

Nothing changes on Gadget. Don't use ggt dev, which syncs both ways. You now have the folder Gadget shows you in its editor: api/models/*/schema.gadget.ts, the actions, accessControl/, settings.gadget.ts, web/, extensions/, and the two shopify.app*.toml files.

Our app's folder had 78 files worth reading: 4 models of its own, 3 synced Shopify models, 20 model actions and 2 global actions, 4 HTTP routes, 7 pages, and one theme extension.

Step 2: import it

From the dashboard, New app → Coming from Gadget? reads the folder in the browser and shows what will convert before anything is created. From a terminal, in a folder linked to an app you've made:

ib-apps import gadget ../booking

The converter reads and writes text. It runs nothing, so a Gadget app's code is safe to hand it. For our app it wrote 21 files and one report, GADGET_IMPORT.md.

What came out

Models. Each schema.gadget.ts became a schema.ib.ts, with every field's storage key kept, which is what makes the record copy in part 2 line up. The shop relationship to shopifyShop became the text field that holds a store's domain, which is how a store's session reaches its own records here. The three synced Shopify models (shopifyShop, shopifyOrder, shopifyOrderLineItem) got our synced schema plus the developer's own fields on them.

Actions. Imports moved from gadget-server to the SDK, with a compatibility file, api/lib/gadget-compat.ts, for the helpers that have no counterpart, each of which throws with a message naming the report until it's ported. Global actions are called through api.$global. Triggers moved into settings.ib.ts.

Eight action files were left out, and the report says why. Gadget writes a file for every model's create, update and delete, and for a Shopify model's install, reinstall, uninstall and update. In this app those files only did what the platform does with no file at all: applyParams and save. So they weren't copied, and nothing they did is lost. The report says how to add one back when an action needs code of its own, and that for a synced Shopify model it then runs after the sync writes the record.

Permissions. Roles kept their names. Gelly filters of the usual shapes (a store's own records, a customer's own records) became inline filters or the automatic tenancy.

Settings. settings.ib.ts was written from the actions' triggers: the schedules, the Shopify scopes, the app's own webhooks.

A skill. .agents/skills/migrate-from-gadget/SKILL.md is written into every imported app. It teaches Claude Code, Cursor or Codex the same mapping the report uses, so the agent that clears the to-do list knows what it's looking at.

The report

GADGET_IMPORT.md is the part worth reading slowly. It's a to-do list in sections, with a checkbox per item, and for our app it had 53 items:

SectionItemsWhat they are
Code29Lines that need a person, file by file
Shopify9Scopes, the existing Shopify apps, webhooks, the extension
HTTP routes5Gadget routes to port to Next.js route handlers
Models4What the schemas lost or changed on the way
Actions3Code in models that aren't kept
Settings2Schedules and their environments
Frontend1The pages

The Code section is the long one and the easy one. Almost every item is one of four mechanical rewrites, with the line numbers:

  • A record's store is now its shop text field: a filter on the relationship becomes { shop: { equals: shop } }. Seventeen of the 29 are this.
  • findMany answers { records, hasNextPage, endCursor } where Gadget returned a list. The import added .records where the call was awaited directly, and lists the places it couldn't.
  • Gadget's edges/node shape on a hasMany becomes { select } and { records, hasNextPage }.
  • api.internal.<model> became api.<model>, which runs the model's action where Gadget's internal API skipped it. The report asks you to check that's right, because sometimes it isn't.

Plus one that's always there for a theme extension: two lines in booking.liquid that pointed at Gadget's hosting, to repoint at the app's address here.

The Shopify section had the item that matters most for a public app: to keep every store installed, connect the Gadget app's own Shopify apps instead of creating new ones, with the two client ids, one per environment. That's part 2, with the records. The rest were the six scopes to set per environment, a note that the TOML's webhook subscriptions are Gadget's and ours come from the sync and settings.ib.ts, and three synced-model actions that run after the sync writes a record, as they did on Gadget, to check against the new record shape.

Models named the three built-in Gadget models that aren't models here, session, shopifyGdprRequest and shopifySync, with where each one's job went: sessions come from verifyShopifySession, privacy webhooks from two named actions, sync runs from the platform. And one small thing a person has to know: a Gadget date field became a dateTime, so code that compared dates should read it as YYYY-MM-DD.

HTTP routes listed each Fastify route with the web/app/<path>/route.ts it becomes and the handler signature. Keep the paths and the widget's links keep working. A boot plugin that set CORS became one line in settings.ib.ts.

Frontend was one line for seven pages: the frontend isn't converted. React Router routes become Next.js pages in web/app. Polaris and App Bridge carry over; records come through the SDK's /react hooks. This is the real work of the move, and part 5 is about it.

How long it takes

With the report open in one tab and Claude Code in another, pointed at the skill:

  • The 29 code items are an afternoon. They're mechanical, the line numbers are right, and the Problems panel in the dashboard shows what still doesn't type-check as you push.
  • The Shopify and settings items are an hour of clicking, mostly in Settings → Shopify.
  • The routes are an hour each, mostly spent on the request parsing Fastify did for you.
  • The seven pages are the rest of the week.

Then the records. Once the models are pushed, ib-apps import gadget --records https://<app>--development.gadget.app copies the Gadget environment's records into development with a Gadget API key that has the system-admin role, relationships kept, synced Shopify records included. Run it again and it updates what it copied. That's part 2.

Do it before Gadget's support goes quiet

Everything above reads from a folder, so you can run the import today, read the report, and put the folder away. The report is the estimate. If something in it needs Gadget's support to answer, you want to be asking in December, not March.

Once the records copy from Gadget has finished, the move checklist in Settings → General also offers your team two months of Apps Pro free, claimed with one click: unlimited production apps and store installs while you finish the move. After that Pro is $20 a month from your team's balance, or the team moves to Free if the balance can't pay it, and we email a week before.

Frequently asked questions

Does the import change anything on Gadget?

No. ggt pull reads your app's files, and the import reads that folder. Nothing on Gadget changes until the switch-over in part 2, and your Gadget app keeps running throughout.

Why were some action files left out?

Gadget writes a file for every create, update, delete, install and uninstall. Ones that only called applyParams and save do what the platform does with no file, so they aren't copied. Add one back at the same path when the action needs code of its own.

Is the import safe to run on code I haven't read?

Yes. It reads and writes text and runs nothing. The compatibility file it writes for Gadget helpers with no counterpart throws with a message when called, until each is ported.

Can I run it again after fixing things?

Yes. ib-apps import gadget <folder> --force replaces files that differ, which also picks up converter improvements. Keep your own changes in version control first.

One bill for your apps, your models and your reviews.

Host apps and functions next to your model traffic. Routing picks each turn's model by your quality floor, and Auditor reviews every pull request against your own rules.