Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs(migration): update to use new runtimeConfig #4642

Merged
merged 4 commits into from
Apr 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/content/migration/8.runtime-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When referencing these variables within your components, you will have to use th

## Migration

1. Add any environment variables you use in your app to your `publicRuntimeConfig` or `privateRuntimeConfig`.
1. Add any environment variables that you use in your app to the `runtimeConfig` property of the `nuxt.config` file.
1. Migrate `process.env` to `useRuntimeConfig` throughout the Vue part of your app.

## Example
Expand All @@ -25,9 +25,9 @@ import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
runtimeConfig: {
secretKey: '', // variables that can only be accessed on server-side
secretKey: '', // variable that can only be accessed on the server side
public: {
BASE_URL: process.env.BASE_URL || 'https://nuxtjs.org'
BASE_URL: process.env.BASE_URL || 'https://nuxtjs.org' // variable that can also be accessed on the client side
}
},
})
Expand Down