Git Providers
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.
Publication Requirements
To publish content changes to your repository, Studio needs a valid access token with write permissions. The token can come from two sources:
OAuth-based Access (Automatic)
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_APPLICATION_SECRET=<your_gitlab_secret>
Personal Access Token (Manual)
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>
Automatic Detection
When deploying on Vercel, Netlify, GitHub Actions, or GitLab CI, Studio automatically detects the repository provider, owner, repo, and branch from the platform's environment variables.
This means you can skip the studio.repository configuration entirely on these platforms — just set up your Auth provider and deploy.
owner and repo are not set in your nuxt.config.ts. Any manually configured values always take precedence.Supported Providers
Studio supports two Git providers for repository operations: GitHub and GitLab.
GitHub
When deploying on Vercel or Netlify with a GitHub repository, the configuration below is automatically detected. You can also configure it manually in nuxt.config.ts:
export default defineNuxtConfig({
studio: {
repository: {
provider: 'github',
owner: 'your-username',
repo: 'your-repo',
branch: 'main' // Optional, defaults to 'main'
}
}
})
Creating a GitHub Personal Access Token
Navigate to GitHub Token Settings
Go to GitHub Settings → Personal access tokens and create a new Fine-grained Personal Access Token.
Configure the GitHub Token
Fill in the required fields:
- Token name: Your app name
- Resource owner: The GitHub organization (or user) the repository belongs to
- Repository access: Select Only select repositories and choose your repository
- Permissions: Click Add permission and select Contents then update access to Read and write
Set GitHub Environment Variable
Add the token to your deployment platform's environment variables:
STUDIO_GITHUB_TOKEN=<your_github_personal_access_token>
GitLab
When deploying on GitLab CI, the configuration below is automatically detected. You can also configure it manually in nuxt.config.ts:
export default defineNuxtConfig({
studio: {
repository: {
provider: 'gitlab',
owner: 'your-username', // or group name
repo: 'your-repo',
branch: 'main' // Optional, defaults to 'main'
}
}
})
Creating a GitLab Personal Access Token
Navigate to GitLab Token Settings
Go to User Settings → Personal access tokens (or your group/organization settings if applicable) on GitLab.
Configure the GitLab Token
Fill in the required fields:
- Name: Your app name
- Expiration date: Set according to your security policy (GitLab defaults to 365 days, and non-expiring tokens are not allowed on most instances). See GitLab's guidance on expiry limits.
- Scopes:
api(required for reading/writing repository content)Copy the generated token immediately; you won't be able to see it again.
Set GitLab Environment Variable
Add the token to your deployment platform's environment variables:
STUDIO_GITLAB_TOKEN=<your_gitlab_personal_access_token>
Working with Branches
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.
Configure Your Branch
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'
}
}
})
Deploy Your Staging Environment
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., staging.yourdomain.com).
Configure Auth Provider for Staging
Create a new OAuth App specifically for your staging environment with your staging URL as callback URL. See Auth Providers for setup instructions.
Set Environment Variables
Configure your staging deployment environment variables depending on the Git and Auth provider you are using.
Access Studio on Staging
Navigate to https://staging.yourdomain.com/_studio to edit content. All commits will be pushed to your configured staging branch.
Merging to Production
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.
Automatic pull request creation from Studio is planned for a future release. For now, you'll need to manually create PRs to merge staging changes into your main branch.