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

Commit

Permalink
docs: add note about runtime config serialization (#8432)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Roe <daniel@roe.dev>
  • Loading branch information
BracketJohn and danielroe committed Oct 24, 2022
1 parent 6bcd9cd commit 7b20e13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/content/2.guide/4.going-further/10.runtime-config.md
Expand Up @@ -39,6 +39,12 @@ console.log(runtimeConfig.public.apiBase)
When using Options API the public runtime config is available via `this.$config.public`.
::

### Serialization

Your runtime config will be serialized before being passed to Nitro. This means that anything that cannot be serialized and then deserialized (such as functions, Sets, Maps, and so on), should not be set in your `nuxt.config`.

Instead of passing non-serializable objects or functions into your application from your `nuxt.config`, you can place this code in a Nuxt or Nitro plugin or middleware.

### Environment Variables

The most common way to provide configuration is by using [Environment Variables](https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa).
Expand Down

0 comments on commit 7b20e13

Please sign in to comment.