Options

Configure Nuxt Directus easily with the directus property.


nuxt.config
export default {  // Defaults options  directus: {    autoFetch: true,  }}

url

  • No default - Required

The url to which requests are made to. It is possible to set/change it at runtime via NUXT_PUBLIC_DIRECTUS_URL env variable.

autoFetch

  • Default: true

Should the user be fetched automatically

autoRefresh

  • Default: false

Auto refesh tokens

onAutoRefreshFailure()

  • Default: not defined

The function that get called if the autoRefresh fail

cookieMaxAge

  • Default: 604800000

Need to be the same as specified in your directus env config (defaults to 7d); this is the max amount of milliseconds that your refresh cookie will be kept in the browser. This value could be configured in a more human readable way as 7 * 24 * 60 * 60 * 1000.

Auto refesh tokens

cookieSameSite

  • Default: lax

The SameSite attribute for auth cookies.

cookieSecure

  • Default: false

The Secure attribute for auth cookies.

fetchUserParams

  • No default - Optional

The Parameters which should be sent when the user is fetched, see DirectusQueryParams

token

  • No default - Optional

A static token

cookieNameToken

  • Default: directus_token

Specify the cookie name of the directus auth token

cookieNameRefreshToken

  • Default: directus_refresh_token

Specify the cookie name of the directus refresh auth token

devtools

  • Default: false

Activate the Nuxt Devtools, checkout Devtools before activating