Tina Docs
Home
Blog
Showcase
Community
Introduction
Overview
Introduction To TinaCMS
Getting Started
Using the Tina Editor
FAQ
Core Concepts
Content Modeling
Data Fetching
Visual Editing
Querying Content
Overview
Writing custom queries
Editing
Overview
Markdown & MDX
Block-based editing
Single Document Collections
Customizing Tina
Overview
Validation
Custom Field Components
Custom List Rendering
Format and Parse Input
Filename Customization
Before Submit function
Going To Production
Overview
Tina Cloud
Self-Hosted
Drafts
Overview
Draft Fields
Editorial Workflow
Guides
Overview
Framework Guides
Separate Content Repo
Querying Tina Content at Runtime
Internationalization
Migrating From Forestry
Further Reference
Overview
Config
Schema
The "tina" folder
The TinaCMS CLI
Media
Search
Content API
Tina's edit state
The "tinaField" helper
Self-Hosted Components

Config Reference

Table of Contents

The config file

When you provide a file at tina/config.{ts,tsx,js,jsx} that exports a defineConfig function, Tina will automatically generate TinaCMS as a static asset. Note that it must be the default export of this file.

The location for the config file was previously at .tina/config.{ts,tsx,js,jsx}

Definition

PropertyDescription
branchThe branch that will be used to query content on TinaCloud (Not used in local mode)
clientIdThe ClientId generated on TinaCloud (Not used in local mode)
tokenA read only token generated on TinaCloud (Not used in local mode)
buildBuild configuration for storing Tina as a static asset
build.publicFolderThe public asset folder for your framework
build.outputFolderWithin the public asset folder, the desired output location
build.basePathIf your site will be served at a sub-path like my-domain.com/my-site, provide "my-site"
mediaMedia configuration for external and git backed media
schemaThe schema defines the shape of your content.
searchSearch configuration

Example

const branch =
process.env.NEXT_PUBLIC_TINA_BRANCH ||
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF ||
process.env.HEAD ||
'main'
export default defineConfig({
branch,
token: '<Your Read Only Token>' // generated on app.tina.io
clientId: '<Your Client ID>', // generated on app.tina.io
build: {
publicFolder: 'public', // The public asset folder for your framework
outputFolder: 'admin' // within the public folder
}
// See https://tina.io/docs/reference/schema/ for more information
schema: {
collections: [
//..Array of collections
],
}
})

In this example, the TinaCMS admin will be viewable at <my-site-url>/admin/index.html. For more information check out the content modeling section.

Last Edited: September 29, 2022

Previous
Reference
Next
The Schema

Product

Showcase
TinaCloud
Introduction
How Tina Works
Roadmap

Resources

Blog
Examples
Support
Media

Whats New
TinaCMS
TinaCloud
Use Cases
Agencies
Documentation
Teams
Jamstack CMS
Benefits
MDX
Markdown
Git
Editorial Workflow
Customization
SEO
Comparisons
TinaCMS vs Storyblok
TinaCMS vs Sanity
TinaCMS vs DecapCMS
TinaCMS vs Contentful
TinaCMS vs Builder.io
TinaCMS vs Strapi
Integrations
Astro
Hugo
NextJS
Jekyll