Options

Configure nuxt-typo3 with the typo3 property or use the public runtime config.

nuxt.config.ts
export default defineNuxtConfig({
  typo3: {
    api: {
      baseUrl: 'https://api.t3pwa.com'
    }
  },
  // or
  runtimeConfig: {
    public: {
      typo3: {
        ...
      }
    }
  }
})

baseUrl

This field provides the base site URL for setting the default URL for handling canonical and hreflang links. It is an optional field, but if left empty, canonical and hreflang links will not be set automatically.

export default defineNuxtConfig({
  typo3: {
    baseUrl: 'https://mywebsite.com'
  }
})

api

This provides API information.

export default defineNuxtConfig({
  typo3: {
    api: {
      baseUrl: 'https://api.t3pwa.com',
      headers: {},
      credentials: 'omit',
      proxyHeaders: false,
      allowQuery: true,
      endpoints: {
        initialData: '?type=834',
        initialDataFallback: '/?type=834'
      }
    },
  }
})

baseUrl

  • Required
  • Default: 'https://api.t3pwa.com'

Define your TYPO3 API host.

headers

  • Optional
  • Default: {}

Define default headers for the HTTP client.

credentials

  • Optional
  • Default: 'omit'
  • Available values: 'include' | 'omit' | 'same-origin'

Configure credentials for the HTTP client.

proxyHeaders

  • Optional
  • Default: 'false'
  • Available values: Boolean | Array<string>

Should the API Client proxy headers from TYPO3 to a Node.js Response? You can provide an array of strings with header names. All headers should be provided as lower-case. Read more about headers

proxyReqHeaders

  • Optional
  • Default: 'false'
  • Available values: Boolean | Array<string>

Should the API Client proxy headers from Node.js Requets to TYPO3 API? You can provide an array of strings with header names. All headers should be provided as lower-case. Read more about headers

allowQuery

  • Optional
  • Default: 'true'
  • Available values: Boolean | Array<string>

Should the API provide query parameters for page calls? You can provide an array of strings with header names.

endpoints

This provides custom endpoint settings.

initialData?

  • Default: /?type=834

Define the endpoint to fetch TYPO3 initialData.

Be aware that an endpoint starting with a slash means the module fetches InitialData only for the main page on initial load (including the current locale). When you omit the slash, InitialData will be fetched for the current page.

initialDataFallback?

  • Default: /?type=834

Define fallback for initialData.

i18n

This provides available locales.

export default defineNuxtConfig({
  typo3: {
    i18n: {
      default: 'en',
      locales: ['en']
    }
  }
})

default

  • Optional
  • Default: 'en'

Default locale.

locales

  • Optional
  • Default: [en]

Array of available language codes. They are used to detect the language in the current URL.

features?

Switch off/on default features.

export default defineNuxtConfig({
  typo3: {
    features: {
      i18nMiddleware: true,
      debug: false
    }
  }
})

i18nMiddleware

  • Optional
  • Default true

Enable/Disable middleware responsible for language detection.