Multi-tenancy

Working with multi-tenancy in the Nuxt Statamic module.
Using multi-tenancy requires the @nobears-front-end/nuxt-multi-tenancy module to be installed and configured in your project.

Enabling Multi-tenancy

You need to enable the multiTenancy option in the module configuration to use the multi-tenancy features of the module.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nobears-front-end/nuxt-statamic'],
  statamic: {
    multiTenancy: true,
  },
});

Composables

When multi-tenancy is enabled, the module will replace the useStatamicSite composable with the useStatamicMultiTenancySite composable.

You still use it as useStatamicSite in your project, but it will now return the multi-tenancy site identifier based on the site configuration of the current tenant.