Skip to content

Configuration

Configure Nuxt Cron with the cron property.

ts
// nuxt.config.ts
export default defineNuxtConfig({
  cron: {
    runOnInit: true,
    timeZone: 'Africa/Abidjan',
    jobsDir: 'cron'
  }
})
KeyTypeDefaultDescription
runOnInitbooleanfalseInstantly triggers the callback function post initialization.
timeZonestringlocal timeSets the execution time zone. Check valid formats in the Luxon documentation
jobsDirstringcronThe jobs directory located in server for auto-import