Deployment
Not independently verified against a live deploy. This guide is based on how tinacms build / nuxt build behave locally, plus standard hosting-provider conventions: not a confirmed production deploy of an app using this module. If a step turns out wrong when you try it, let us know so this page can be corrected.
Build command
Unlike dev (tinacms dev -c "nuxt dev", which always runs in local mode), a production build needs tinacms build (not dev) so the admin gets built as a static bundle that connects to Tina Cloud, instead of local mode:
tinacms build && nuxt build
tinacms build generates tina/__generated__/client.ts (used by your server routes) and the production admin bundle (served from public/admin/), then nuxt build builds the Nuxt app itself.
Environment variables
Set these on your hosting provider (production and preview environments):
NUXT_TINA_CLIENT_ID=
NUXT_TINA_TOKEN=
NUXT_TINA_BRANCH=main
If you're also using Cloudinary:
NUXT_TINA_CLOUDINARY_CLOUD_NAME=
NUXT_TINA_CLOUDINARY_API_KEY=
NUXT_TINA_CLOUDINARY_API_SECRET=
See Media & Cloudinary for the full picture: Cloudinary needs a couple more env vars beyond these, read by the tinacms CLI and by next-tinacms-cloudinary under their own naming conventions.
What to check on a real deploy
- That
/admin/index.htmlis served correctly as a static asset frompublic/admin/in your hosting provider's environment. - That the Tina Cloud login actually appears (not "local mode"), that's the main signal a production build is configured correctly, the same thing verified locally in Tina Cloud & Editing Modes via
nuxi preview, but not yet on a real hosting provider. - If you're deploying inside a monorepo (module + app in the same repo, or
tina/config.tsoutside the app's root), your provider's root directory / build command settings likely need adjusting sotina/config.tsandcontent/are reachable from the build step.