You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//GitHub repository configuration (owner and repo are required)
59
+
//Git repository configuration (owner and repo are required)
60
60
repository: {
61
-
provider: 'github', //only GitHub is currently supported
62
-
owner: 'your-username', // your GitHub username or organization
61
+
provider: 'github', //'github' or 'gitlab'
62
+
owner: 'your-username', // your GitHub/GitLab username or organization
63
63
repo: 'your-repo', // your repository name
64
64
branch: 'main', // the branch to commit to (default: main)
65
-
rootDir: ''// optional: if your Nuxt app is in a subdirectory (default: '')
66
65
}
67
66
}
68
67
})
69
68
```
70
69
71
-
::callout
70
+
### Options
71
+
72
+
#### Root directory `default: ''`
73
+
72
74
If your Nuxt Content application is in a monorepo or subdirectory, specify the `rootDir` option to point to the correct location.
73
-
::
74
75
75
-
## GitHub OAuth App
76
+
```ts [nuxt.config.ts]
77
+
exportdefaultdefineNuxtConfig({
78
+
studio: {
79
+
repository: {
80
+
...
81
+
rootDir: 'docs'
82
+
}
83
+
}
84
+
})
85
+
```
76
86
77
-
Nuxt Studio uses GitHub OAuth for authentication.
87
+
#### Private Repository Access `default: true`
78
88
79
-
::prose-steps
89
+
By default, Studio requests access to both public and private repositories.
80
90
81
-
### Navigate to GitHub Developer Settings
91
+
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.
82
92
83
-
Go to [GitHub Developer Settings](https://github.com/settings/developers) and click **New OAuth App**
:note[If you want to try studio locally, set the callback url to your local url `http://localhost:3000`]
108
+
Once your project is running locally, any file changes will be synchronized in real time with the file system.
93
109
94
-
### Copy Your Credentials
110
+
::warning
111
+
The publish system is only available in production mode. You can use your classical workflow (IDE, CLI, GitHub Desktop...) to publish your changes in local.
112
+
::
95
113
96
-
After creating the OAuth app, you'll receive:
114
+
## Production mode
97
115
98
-
- A **Client ID** (visible immediately)
99
-
- A **Client Secret** (click **Generate a new client secret**)
116
+
While Nuxt Studio can be useful during development (especially with the upcoming Studio editor) its main advantage is the ability to publish changes directly from your production website.
100
117
101
-
### Set your environment Variables
118
+
### OAuth Configuration
102
119
103
-
Add the GitHub OAuth credentials to your deployment platform's environment variables or in your `.env` file in local
120
+
To enable this Nuxt Studio supports authentication through both GitHub and GitLab OAuth providers allowing you to log in and publish updates from production.
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.
135
-
136
-
This is useful when you want to review changes on a preview environment before merging to production. You can currently handle pull requests manually from GitHub, but automatic PR creation is included in our roadmap and will be implemented in a future release.
137
-
138
-
::prose-steps
139
-
### Configure
140
-
141
-
Update your `nuxt.config.ts` to target your staging branch.
142
-
143
-
:::tip
144
-
You can use environment variables to manage multiple branches for different environments.
145
-
:::
146
-
147
-
```ts [nuxt.config.ts]
148
-
exportdefaultdefineNuxtConfig({
149
-
studio: {
150
-
repository: {
151
-
owner: 'your-username',
152
-
repo: 'your-repo',
153
-
branch: PROCESS.ENV.STUDIO_GITHUB_BRANCH_NAME, // Target your staging branch instead of main
154
-
}
155
-
}
156
-
})
157
-
```
158
-
159
-
### Deploy
160
-
161
-
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., `staging.yourdomain.com`).
162
-
163
-
### Create a Separate GitHub OAuth App
164
-
165
-
Create a new OAuth App specifically for your staging environment:
Navigate to `https://staging.yourdomain.com/_studio` to edit content. All commits will be pushed to your configured staging branch.
184
-
185
-
### Merging to Production
186
-
187
-
Once you're satisfied with changes on your staging branch, create a pull request from your staging branch to your main branch on GitHub to deploy to production.
188
-
189
-
:::note
190
-
**Pull Request Automation Coming Soon**
191
-
192
-
:br
193
-
194
-
Automatic pull request creation from Studio is planned for a future release. For now, you'll need to manually create PRs on GitHub to merge staging changes into your main branch.
195
-
:::
196
-
::
197
-
198
147
### Accessing Studio
199
148
200
149
After deployment, access the Studio interface by navigating to your configured route (default: `/_studio`):
201
150
202
-
1. Click **Login with GitHub** if it does not directly redirect to the OAuth app authorization page
151
+
1. Click the login button if it does not directly redirect to the OAuth app authorization page
203
152
2. Authorize the OAuth application
204
-
3. You'll be redirected back to Studio, ready to edit your content
153
+
3. You'll be redirected back to Studio ready to edit your content
205
154
206
155
::note
207
156
Secure OAuth-based login with **Google** should be available quickly in the Beta release.
208
157
::
209
158
210
159
::tip
211
-
You can also use the shortcut :kbd{value="meta"} + :kbd{value="."} to redirect to the Studio route.
160
+
You can also use the shortcut `CMD` + `K` to redirect to the Studio route.
212
161
::
213
-
214
-
## Development mode
215
-
216
-
Nuxt Studio includes an **experimental** development mode that enables real-time file system synchronization:
217
-
218
-
```ts [nuxt.config.ts]
219
-
exportdefaultdefineNuxtConfig({
220
-
studio: {
221
-
development: {
222
-
sync: true// Enable development mode
223
-
}
224
-
}
225
-
})
226
-
```
227
-
228
-
When enabled, Nuxt Studio will:
229
-
230
-
- ✅ Write changes directly to your local `content/` directory
231
-
- ✅ Write media changes to your local `public/` directory
232
-
- ❌ Listen for file system changes and update the editor
233
-
- ❌ Commit changes to your repository (use your classical workflow instead)
description: Configure OAuth providers and synchronizes content between your production website and your Git repository.
4
+
navigation:
5
+
title: Providers
6
+
seo:
7
+
title: Git Integration with Studio
8
+
description: Configure GitHub or GitLab OAuth and synchronizes content between your production website and your Git repository.
9
+
---
10
+
11
+
::prose-note
12
+
After initial OAuth setup, synchronization happens automatically and requires no manual action.
13
+
::
14
+
15
+
## OAuth Providers
16
+
17
+
Nuxt Studio supports authentication with both GitHub and GitLab OAuth providers.
18
+
19
+
### GitHub OAuth App
20
+
21
+
To use GitHub as your Git provider, you need to create a GitHub OAuth application.
22
+
23
+
::prose-steps{level="4"}
24
+
#### Navigate to GitHub Developer Settings
25
+
26
+
Go to [GitHub Developer Settings](https://github.com/settings/developers) and click **New OAuth App**
27
+
28
+
#### Configure the OAuth Application
29
+
30
+
Fill in the required fields:
31
+
32
+
-**Application name**: Your app name
33
+
-**Homepage URL**: `https://yourdomain.com`
34
+
-**Authorization callback URL**: `https://yourdomain.com`:note[If you want to try studio locally, set the callback url to your local url `http://localhost:3000`]
35
+
36
+
#### Copy Your Credentials
37
+
38
+
After creating the OAuth app, you'll receive:
39
+
40
+
- A **Client ID** (visible immediately)
41
+
- A **Client Secret** (click **Generate a new client secret**)
42
+
43
+
#### Set your environment Variables
44
+
45
+
Add the GitHub OAuth credentials to your deployment platform's environment variables or in your `.env` file in local
To use GitLab as your Git provider, you need to create a GitLab OAuth application.
56
+
57
+
::prose-steps{level="4"}
58
+
#### Navigate to GitLab Applications
59
+
60
+
Go to your GitLab [User Settings → Applications](https://gitlab.com/-/user_settings/applications) (or your group/organization settings) and create a **New Application**.
-**Scopes**: Select `api` (required for publication) :note[If you want to try studio locally, add your local url as redirect URI: `http://localhost:3000/__nuxt_studio/auth/gitlab`]
69
+
70
+
#### Copy Your Credentials
71
+
72
+
After creating the OAuth application, you'll receive:
73
+
74
+
- An **Application ID** (visible immediately)
75
+
- A **Secret** (visible immediately)
76
+
77
+
#### Set your environment Variables
78
+
79
+
Add the GitLab OAuth credentials to your deployment platform's environment variables or in your `.env` file in local
That's it! Once deployed with the appropriate credentials set as environment variables. Studio will be accessible from your production instance. Just login on the `/_studio` (or on the route you've configured) to start editing.
89
+
::
90
+
91
+
## Advanced options
92
+
93
+
### Custom Redirect URL
94
+
95
+
By default, Studio uses your deployment URL as the OAuth redirect URL. If you need to customize it you can specify a custom redirect URL:
This is useful when you need to handle OAuth callbacks through a specific endpoint.
107
+
::
108
+
109
+
## Working with Staging/Preview Branches
110
+
111
+
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.
112
+
113
+
This is useful when you want to review changes on a preview environment before merging to production. You can currently handle pull requests manually from GitHub, but automatic PR creation is included in our roadmap and will be implemented in a future release.
114
+
115
+
::prose-steps
116
+
### Configure
117
+
118
+
Update your `nuxt.config.ts` to target your staging branch.
119
+
120
+
:::tip
121
+
You can use environment variables to manage multiple branches for different environments.
122
+
:::
123
+
124
+
```ts [nuxt.config.ts]
125
+
exportdefaultdefineNuxtConfig({
126
+
studio: {
127
+
repository: {
128
+
owner: 'your-username',
129
+
repo: 'your-repo',
130
+
branch: PROCESS.ENV.STUDIO_BRANCH_NAME, // Target your staging branch instead of main
131
+
}
132
+
}
133
+
})
134
+
```
135
+
136
+
### Deploy
137
+
138
+
Configure your hosting platform to deploy the staging branch to a preview URL (e.g., `staging.yourdomain.com`).
139
+
140
+
### Create a Separate OAuth App (based on your Git provider)
141
+
142
+
Create a new OAuth App specifically for your staging environment and use your staging URL as callback URL.
143
+
144
+
### Set Environment Variables
145
+
146
+
Configure your staging deployment env varibales with the staging OAuth credentials.
Navigate to `https://staging.yourdomain.com/_studio` to edit content. All commits will be pushed to your configured staging branch.
157
+
158
+
### Merging to Production
159
+
160
+
Once you're satisfied with changes on your staging branch, create a pull request from your staging branch to your main branch on GitHub to deploy to production.
161
+
162
+
:::note
163
+
**Pull Request Automation Coming Soon**
164
+
165
+
:br
166
+
167
+
Automatic pull request creation from Studio is planned for a future release. For now, you'll need to manually create PRs on GitHub to merge staging changes into your main branch.
0 commit comments