Vue Storefront is now Alokai! Learn More
Nuxt module

Nuxt module

This document explains how Nuxt module is implemented. As all it is doing right now is registering a Nuxt plugin. We focus on that part.

Plugin

It:

Then you can access config, engines, and controllers using useNuxtApp composable:

const {
  $coveo: {
    config: coveoEngineConfig,
    server: {
      engineDefinition: coveoSSREngine,
      fetchStaticState: coveoSSREngine.fetchStaticState,
      hydrateStaticState: coveoSSREngine.hydrateStaticState,
    },
    client: {
      engines: {
        headlessEngine,
        productRecommendationsEngine,
      },
      controllers: {
        searchBox,
        instantResults,
      },
    },
  }
} = useNuxtApp();

We also use it internally in prepared by us Composables and Components.