Loving Tina? us on GitHub0.0k
v.Latest
Documentation

Deploying to Netlify

Loading last updated info...
On This Page

Build Configuration

In Netlify, your build configuration can be updated at Settings > Build & Deploy > Build Command.

Netlify build config

Figure: Netlify build config

If your package.json has a "build" script like tinacms build && <your-site-build-cmd>, this likely doesn't need to be changed. If your Netlify config is not running a custom build script (e.g next build), you would have to change this to tinacms build && next build
If your project has a netlify.toml with a build command set, that will take precedence over the above build command UI

Environment variables

Assuming that your Tina clientID and token are setup as environment variables, you will need to add those to the Netlify UI for your project. You can learn more about Netlify environment variables.

tinacms build requires environment variables like TINA_TOKEN and NEXT_PUBLIC_TINA_CLIENT_ID to be available at build time. Make sure these are configured in Netlify's environment settings. If you use a monorepo tool like Turborepo, you may also need to explicitly forward these variables (e.g. via the env key in turbo.json) — otherwise tinacms build may not receive them even if they are set in Netlify. See the Environment Variables reference for details.