Skip to content

Commit

Permalink
docs: update docs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebilicious committed Aug 7, 2023
1 parent b2a05d5 commit bcc3e40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/content/2.deploy/providers/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,18 @@ NUXT_HELLO_THERE="general"
SECRET="secret"
```

::alert{type="info"}
**Note:** Cloudflare variables are only available within event handlers with `useRuntimeConfig(event)`.
::

```ts
export default defineEventHandler((event) => {
event.context.cloudflare.env.NITRO_HELLO //world
useRuntimeConfig().hello //world
useRuntimeConfig(event).hello //world
event.context.cloudflare.env.NUXT_HELLO //general
useRuntimeConfig().helloThere //general
useRuntimeConfig(event).helloThere //general
event.context.cloudflare.env.SECRET //secret
useRuntimeConfig().secret //undefined
useRuntimeConfig(event).secret //undefined
});
```

Expand Down

0 comments on commit bcc3e40

Please sign in to comment.