onNuxtReady only runs on the client-side. export default defineNuxtPlugin(() => {
  onNuxtReady(async () => {
    const myAnalyticsLibrary = await import('my-big-analytics-library')
    // do something with myAnalyticsLibrary
  })
})
It is 'safe' to run even after your app has initialized. In this case, then the code will be registered to run in the next idle callback.