Lifecycle Hooks

App Hooks (runtime)

Check the app source code for all available hooks.

HookArgumentsEnvironmentDescription
app:createdvueAppServer & ClientCalled when initial vueApp instance is created.
app:errorerrServer & ClientCalled when a fatal error occurs.
app:error:cleared{ redirect? }Server & ClientCalled when a fatal error occurs.
app:data:refreshkeys?Server & Client(internal)
vue:setup-Server & Client(internal)
vue:errorerr, target, infoServer & ClientCalled when a vue error propages to the root component. Learn More.
app:renderedrenderContextServerCalled when SSR rendering is done.
app:redirected-ServerCalled before SSR redirection.
app:beforeMountvueAppClientCalled before mounting the app, called only on client side.
app:mountedvueAppClientCalled when Vue app is initialized and mounted in browser.
app:suspense:resolveappComponentClientOn Suspense resolved event.
link:prefetchtoClientCalled when a <NuxtLink> is observed to be prefetched.
page:startpageComponent?ClientCalled on Suspense pending event.
page:finishpageComponent?ClientCalled on Suspense resolved event.
page:transition:finishpageComponent?ClientAfter page transition onAfterLeave event.

Nuxt Hooks (build time)

Check the schema source code for all available hooks.

Documentation for this section is not yet complete. You can contribute to the documentation.

Nitro App Hooks (runtime, server-side)

HookArgumentsDescriptionTypes
render:responseresponse, { event }Called before sending the response.response, event
render:htmlhtml, { event }Called before constructing the HTML.html, event