Nuxt/docs/3.api/2.composables/use-request-event.md

570 B

title description links
useRequestEvent Access the incoming request event with the useRequestEvent composable.
label icon to size
Source i-simple-icons-github https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/ssr.ts xs

Within your pages, components, and plugins you can use useRequestEvent to access the incoming request.

// Get underlying request event
const event = useRequestEvent()

// Get the URL
const url = event.path

::callout In the browser, useRequestEvent will return undefined. ::