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
[Shelve](https://shelve.cloud) is a secrets management service. This module fetches secrets from Shelve at build time and merges them into your runtime config before validation.
162
175
163
-
### Zero-Config Setup
176
+
### Configure Shelve
164
177
165
-
If you have a `shelve.json` file in your project root, the integration enables automatically:
178
+
Configure Shelve directly in your Nuxt config:
166
179
167
180
```ts
168
181
exportdefaultdefineNuxtConfig({
169
182
safeRuntimeConfig: {
170
183
$schema: runtimeConfigSchema,
171
-
shelve: true, // Auto-detects project, team, and environment
184
+
shelve: {
185
+
project: 'my-app',
186
+
slug: 'my-team',
187
+
},
172
188
},
173
189
})
174
190
```
175
191
176
192
The module resolves configuration from multiple sources (highest priority first):
The runtime plugin runs before validation, so freshly fetched secrets are validated against your schema.
234
251
252
+
### Install Wizard UX
253
+
254
+
On module install, an interactive setup wizard can help bootstrap validation and Shelve config. The wizard now:
255
+
256
+
- shows a preview of planned actions first (install deps, write `~/.shelve`, edit `nuxt.config`)
257
+
- asks for a final confirmation before applying any change
258
+
- skips automatically in CI and non-interactive terminals (non-TTY)
259
+
235
260
## Runtime Validation
236
261
237
262
By default, validation only runs at build time. Enable runtime validation to catch environment variable issues when the server starts:
@@ -289,7 +314,7 @@ The rule includes auto-fix support — run `eslint --fix` to automatically repla
289
314
290
315
## Type Safety
291
316
292
-
Types are auto-generated at build time from your schema's JSON Schema representation. The `useSafeRuntimeConfig()` composable returns a fully typed object — no manual generics needed:
317
+
Types are auto-generated at build time from your schema's JSON Schema representation. The `useSafeRuntimeConfig()` composable returns a fully typed object in both app and server contexts (`app.vue`, `server/api`, `server/utils`) — no manual generics needed:
293
318
294
319
```ts
295
320
const config =useSafeRuntimeConfig()
@@ -311,6 +336,12 @@ When validation fails, you see detailed error messages:
311
336
312
337
The module stops the build process until all validation errors are resolved.
313
338
339
+
## Upcoming Major Release Notes
340
+
341
+
- Shelve setup no longer documents `shelve.json` auto-enablement; supported sources are `nuxt.config`, env vars, and `package.json` fallback for project name.
342
+
- The install wizard now previews actions and requires explicit confirmation before mutating files or writing credentials.
343
+
- Runtime and wizard key-shaping now use the same env-key mapping rules to avoid schema/runtime drift.
344
+
314
345
## Why This Module?
315
346
316
347
Nuxt's built-in schema validation is designed for module authors and broader configuration. This module focuses specifically on **runtime config validation** using Standard Schema, allowing you to:
Copy file name to clipboardExpand all lines: docs/1.guide/3.type-safety.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ icon: ph:shield-check
4
4
5
5
# Type Safety
6
6
7
-
The module generates TypeScript types from your schema, making `useSafeRuntimeConfig()` fully typed without manual generics.
7
+
The module generates TypeScript types from your schema, making `useSafeRuntimeConfig()` fully typed without manual generics in both app and server code.
8
8
9
9
## How It Works
10
10
@@ -56,7 +56,7 @@ interface SafeRuntimeConfig {
56
56
57
57
## Server vs Client
58
58
59
-
On the server, you get the full config. On the client, only `public` properties are available:
59
+
On the server (including `server/api` and `server/utils`), you get the full config. On the client, only `public` properties are available:
0 commit comments