Skip to content

GemSync

GemSync is the code generator that ships with @gemzero0/sdk-core (the gemsync binary). It asks your project’s API for the generated tRPC router and writes it to gemRouter.ts. That one file is what makes every SDK call typed against your actual schema.

GEM_URL and GEM_KEY must be set, either in the environment or in a .env file in the directory you run it from:

GEM_URL=https://sdk.gem0.dev
GEM_KEY=your-project-api-key
Terminal window
bunx gemsync

Writes gemRouter.ts to the current directory. Two options:

InvocationEffect
bunx gemsync src/libWrite gemRouter.ts into a subdirectory (it must exist).
bunx gemsync --without-linksGenerate types without linked-document expansion, matching queries that pass without_links: true.

Rerun GemSync after every schema change. Commit the generated gemRouter.ts like any other source file: builds stay reproducible and the diff shows exactly what changed in the content model.