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

Commit

Permalink
docs(migration): update to use new runtimeConfig (#4642)
Browse files Browse the repository at this point in the history
Co-authored-by: Damian <48835293+DamianGlowala@users.noreply.github.com>
  • Loading branch information
tobiasdiez and DamianGlowala authored Apr 27, 2022
1 parent cc37547 commit ee0b90b
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit ee0b90b

Please sign in to comment.