Setup Nuxt Studio
Installation
Install Nuxt Studio using the Nuxt CLI within your project:
npx nuxt module add nuxt-studio
Development mode
Previous section is enough to be able to edit your content. Just click on the floating button on the bottom left of your page.
When running locally, any file changes will be synchronized in real time with your local filesystem.
Production mode
Studio's main advantage is publishing content changes directly from your production website. This requires two configurations:
Git Provider
Configure where your content is stored and where changes will be committed.
When deploying on Vercel, Netlify, GitHub Actions, or GitLab CI, the repository details (provider, owner, repo, and branch) are automatically detected from the CI environment variables โ no manual configuration is needed.
For other platforms, or to override the detected values, configure the repository manually:
export default defineNuxtConfig({
studio: {
repository: {
provider: 'github', // 'github' or 'gitlab'
owner: 'your-username',
repo: 'your-repo',
branch: 'main'
}
}
})
Auth Provider
Configure how users authenticate to access Studio. Choose from GitHub, GitLab, Google OAuth, or custom authentication:
# Example with GitHub OAuth
STUDIO_GITHUB_CLIENT_ID=<your_client_id>
STUDIO_GITHUB_CLIENT_SECRET=<your_client_secret>
Deployment
Nuxt Studio requires a server-side route for authentication.
While static generation remains supported with Nuxt hybrid rendering, your site must be deployed on a platform that supports server-side rendering (SSR) using nuxt build command.
If you want to pre-render all your pages, use the following configuration:
export default defineNuxtConfig({
nitro: {
prerender: {
// Pre-render the homepage
routes: ['/'],
// Then crawl all the links on the page
crawlLinks: true
}
}
})
Open Studio
Once deployed, open Studio by navigating to your configured route (default: /_studio):
- Click the login button if it does not directly redirect to the OAuth app authorization page
- Authorize the OAuth application
- You'll be redirected back to Studio ready to edit your content
CMD + . to redirect to the Studio route.Options
Add the module to your nuxt.config.ts and configure your repository based on your Git provider:
Admin route
Customize the login route using the route option:
export default defineNuxtConfig({
studio: {
route: '/admin', // default: '/_studio'
}
})
Repository
Use the repository option to specify your git repository to sync in production mode.
When deploying on supported platforms, the repository details are automatically detected from CI environment variables:
| Platform | Provider | Owner | Repo | Branch |
|---|---|---|---|---|
| Vercel | VERCEL_GIT_PROVIDER | VERCEL_GIT_REPO_OWNER | VERCEL_GIT_REPO_SLUG | VERCEL_GIT_COMMIT_REF |
| Netlify | from REPOSITORY_URL | from REPOSITORY_URL | from REPOSITORY_URL | BRANCH |
| GitHub Actions | github | from GITHUB_REPOSITORY | from GITHUB_REPOSITORY | GITHUB_REF_NAME |
| GitLab CI | gitlab | CI_PROJECT_NAMESPACE | CI_PROJECT_NAME | CI_COMMIT_BRANCH |
Auto-detection only applies when owner and repo are not explicitly set. Any manually configured values always take precedence.
To override or for unsupported platforms, configure the repository manually:
export default defineNuxtConfig({
studio: {
repository: {
provider: 'github', // 'github' or 'gitlab', default: 'github'
owner: 'your-username', // your GitHub/GitLab username or organization
repo: 'your-repo', // your repository name
branch: 'main', // the branch to commit to (default: main)
}
}
})
Root directory default: ''
If your Nuxt Content application is in a monorepo or subdirectory, specify the rootDir option to point to the correct location.
export default defineNuxtConfig({
studio: {
repository: {
...
rootDir: 'docs'
}
}
})
Private Repository Access default: true
By default, Studio requests access to both public and private repositories.
Setting private: false limits the OAuth scope to public repositories only, which may be preferable for security or compliance reasons when working with public repositories.
export default defineNuxtConfig({
studio: {
repository: {
...
private: false
}
}
})
Internationalization
Nuxt Studio includes built-in internationalization support with the following languages available:
- ๐ฌ๐ง English (default)
- ๐ธ๐ฆ Arabic
- ๐ง๐ฌ Bulgarian
- ๐ฉ๐ช German
- ๐ช๐ธ Spanish
- ๐ฎ๐ท Farsi
- ๐ซ๐ฎ Finnish
- ๐ซ๐ท French
- ๐ฎ๐ฉ Indonesian
- ๐ฎ๐น Italian
- ๐ฏ๐ต Japanese
- ๐ณ๐ฑ Dutch
- ๐ต๐ฑ Polish
- ๐ง๐ท Portuguese (Brazil)
- ๐บ๐ฆ Ukrainian
- ๐จ๐ณ Chinese
- ๐ฐ๐ท Korean
- ๐จ๐ฟ Czech
- ๐ณ๐ด Norwegian (Bokmรฅl)
- ๐ณ๐ด Norwegian (Nynorsk)
- ๐ท๐บ Russian
- ๐น๐ผ Taiwan (Chinese Traditional)
- ๐ฐ๐ญ Khmer
Set your preferred language using the i18n option:
export default defineNuxtConfig({
studio: {
i18n: {
defaultLocale: 'fr' // 'en', 'fr' or 'de'
}
}
})
This will translate:
- All UI elements and labels
- Monaco editor snippets and code completion
- Contextual messages and notifications
Dev mode
If you want to test your production setup locally, disable the dev option:
export default defineNuxtConfig({
studio: {
dev: false
}
})
Make sure to configure your OAuth provider to redirect to your local dev server (usually http://localhost:3000).
Components Meta
You can control which components are visible in Nuxt Studio using the meta.components option in your nuxt.config.ts. This is useful if you want to hide specific components or only show a subset.
export default defineNuxtConfig({
studio: {
meta: {
components: {
// White-list: If defined, ONLY these components will be visible
include: ['Content*', 'MySpecificComponent'],
// Black-list: These components will be hidden
exclude: ['HiddenComponent', 'content/prose/**']
}
}
}
})
Patterns support glob syntax (*, **) and can match against:
- Component Name: e.g.
Button,Content* - File Path: If the pattern contains a
/, e.g.content/prose/**