Git providers handle the synchronization between Studio and your repository. They are responsible for pushing content changes (commits) to your Git repository when you publish from Studio.
Studio supports two Git providers for repository operations: GitHub and GitLab.
To use GitHub as your Git provider, configure your repository settings in nuxt.config.ts:
export default defineNuxtConfig({
studio: {
repository: {
provider: 'github',
owner: 'your-username',
repo: 'your-repo',
branch: 'main' // Optional, defaults to 'main'
}
}
})
Go to GitHub Settings → Personal access tokens and create a new Fine-grained Personal Access Token.
Fill in the required fields:
Add the token to your deployment platform's environment variables:
STUDIO_GITHUB_TOKEN=<your_github_personal_access_token>
To use GitLab as your Git provider, configure your repository settings in nuxt.config.ts:
export default defineNuxtConfig({
studio: {
repository: {
owner: 'your-username', // or group name
repo: 'your-repo',
branch: 'main' // Optional, defaults to 'main'
}
}
})
Go to User Settings → Personal access tokens (or your group/organization settings if applicable) on GitLab.
Fill in the required fields:
api (required for reading/writing repository content) Add the token to your deployment platform's environment variables:
STUDIO_GITLAB_TOKEN=<your_gitlab_personal_access_token>
To publish content changes to your repository, Studio needs a valid access token with write permissions. The token can come from two sources:
When using GitHub OAuth or GitLab OAuth as your Auth provider, the OAuth token obtained during authentication is automatically used for Git operations. No additional configuration is needed.
# GitHub OAuth - token is obtained automatically during login
STUDIO_GITHUB_CLIENT_ID=<your_github_client_id>
STUDIO_GITHUB_CLIENT_SECRET=<your_github_client_secret>
# Or GitLab OAuth - token is obtained automatically during login
STUDIO_GITLAB_APPLICATION_ID=<your_gitlab_application_id>
STUDIO_GITLAB_CLIENT_SECRET=<your_gitlab_secret>
When using Google OAuth or Custom Auth as your Auth provider, you must provide a Personal Access Token (PAT) with repository write permissions:
# For GitHub repositories
STUDIO_GITHUB_TOKEN=<your_github_personal_access_token>
# For GitLab repositories
STUDIO_GITLAB_TOKEN=<your_gitlab_personal_access_token>
By default, Studio commits changes to the branch specified in your configuration (typically main). However, you can configure Studio to work with a staging or preview branch instead.
This is useful when you want to review changes on a preview environment before merging to production.
Update your nuxt.config.ts to target your staging branch.
export default defineNuxtConfig({
studio: {
repository: {
owner: 'your-username',
repo: 'your-repo',
branch: process.env.STUDIO_BRANCH_NAME || 'main'
}
}
})
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., staging.yourdomain.com).
Create a new OAuth App specifically for your staging environment with your staging URL as callback URL. See Auth Providers for setup instructions.
Configure your staging deployment environment variables depending on the Git and Auth provider you are using.
Navigate to https://staging.yourdomain.com/_studio to edit content. All commits will be pushed to your configured staging branch.
Once you're satisfied with changes on your staging branch, create a pull request from your staging branch to your main branch to deploy to production.