Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nuxt-directus

intevel8.1kMIT5.7.0TypeScript support: included

nuxt-directus

nuxt, directus, nuxtjs, nuxt-module, vue3, nuxt3, directus-module, nuxt-directus, nuxtdirectus, nuxt-community

readme

nuxt-directus

Nuxt Directus

npm version npm downloads License Nuxt

Integrate Directus to your Nuxt application.

Features

  • Nuxt 3 ready
  • Handle authentication
  • RESTful methods
  • TypeScript Support

Setup

npx nuxi@latest module add directus

Basic usage

Add nuxt-directus to your Nuxt config:

// nuxt.config.ts

export default defineNuxtConfig({
  modules: ["nuxt-directus"],
});

Development

  1. Clone this repository
  2. Install dependencies using pnpm install or npm install
  3. Run pnpm dev:prepare or npm run dev:prepare
  4. Start development server using pnpm dev or npm run dev

License

Copyright (c) 2022 Conner Luka Bachmann MIT License

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

v5.7.0

🚀 Enhancements

  • Add file upload and deletion functionality (f805a9e)

🩹 Fixes

  • Add runtime types to type exports (429554c)

📖 Documentation

  • Use new nuxi module add command in installation (2ea7888)

🏡 Chore

  • Indicate compatibility with new v4 major (cefc5e3)
  • Rename domain (5d4af61)
  • Update pnpm (029e413)

❤️ Contributors

v5.6.1

🩹 Fixes

  • CreateUser documentation (5b207b4)
  • Add types to package.json exports (ce3b141)
  • Opt in to import.meta.* properties (bb24196)

🏡 Chore

  • Update ci.yml (0144c6a)

❤️ Contributors

v5.6.0

🚀 Enhancements

  • Warning "maxAgeRefreshToken deprecated" (035b382)
  • Documentation updates, own hero (dd4dfd6)
  • Rewrite feedback to plausible events (5bc6ab6)
  • Update files url (980b91e)
  • Remove trailing slash if present (ad28fee)
  • Ensures url does not ends with a trailing slash (d3e429e)

🩹 Fixes

  • Wrong default cookieMaxAge fixes #181 (#181)
  • Default env directus url (c211585)
  • Mobile padding (9d961eb)
  • Readme link (16741bd)
  • Remove deprecation notes (46bd2d1)

💅 Refactors

  • Minor eslinting (7b3633a)

📖 Documentation

  • Fix usedirectustoken (7f788df)
  • Fix wrong default (b21826c)
  • Fix middleware example (84bef8b)
  • Update cover (564e20e)
  • Add deprecation notes (0e3869f)

🏡 Chore

  • Update readme links (86d8b2f)
  • Update docs links in package.json (3cceb24)
  • deps-dev: Bump @antfu/utils from 0.7.2 to 0.7.5 (a2c764c)

❤️ Contributors

v5.5.0

🚀 Enhancements

  • ✨ Add inviteUser and inviteAccept (5509f7a)

🩹 Fixes

  • Linting (75a06b0)
  • NavigateTo is undefined && middleware warning (5549ccc)

📖 Documentation

  • 📝 Add DirectusInvite types to documentation. (115cd0d)

🏡 Chore

  • Fix publish command (54477f7)

❤️ Contributors

v5.4.4

🩹 Fixes

  • 'token_expired' always 'true'. #157 (#157)

📖 Documentation

  • Add autoRefresh (f85c44c)
  • Add onAutoRefreshFailure (01dd6cd)
  • Added maxAgeRefreshToken (39597cf)
  • 149 useAsyncData (#149)

🏡 Chore

  • release: V5.4.1 (19610b2)

❤️ Contributors

v5.4.3

🩹 Fixes

  • UseRoute is undefined (1c95841)

❤️ Contributors

v5.4.2

🩹 Fixes

  • Invalid url parsing (b7cba7a)
  • UseDirectusUrl is not defined (3001e9b)

❤️ Contributors

v5.4.1

🩹 Fixes

  • Computed import (65c1cdf)

❤️ Contributors

v5.4.0

🚀 Enhancements

  • Add computed values for token expiration. (4195895)
  • Modify plugin to fetch data when needed on app/page load. (764d02e)
  • Add auto-refreshing tokens to plugin and directus handler. (570fbdf)
  • Login with provider. (50370f7)
  • Allow maxAge for the refresh token to be set. (c9fa234)
  • Remove the refresh token, if it fails to refresh. (336e3a9)
  • Add auto-refresh failure function (0e709d8)

🩹 Fixes

  • Missing uuid dependancy (cb800ce)
  • Login/logout to not use the directus handler. (43e896e)
  • Missing uuid dependancy" (71c7357)
  • Invalid key path for maxAge (25efffd)
  • Remove setting default config, for keys that no longer exist. (2b0ec0c)
  • Config defaults to public inside useTokens (ddaaa65)
  • Move after token_expired as it's used within. (9ff4c19)
  • Error throwing (26a8b0a)

❤️ Contributors

v5.3.0

🚀 Enhancements

  • Add Avif type support to DirectusThumbnailFormat (#141)

❤️ Contributors

  • Alberto

v5.2.1

🩹 Fixes

  • UseDirectusToken.ts #140 (#140)

❤️ Contributors

v5.2.0

🚀 Enhancements

  • Make auth cookie names configurable (6193e2e)
  • Integrated directus admin dashboard to devtools (#138)

🩹 Fixes

  • Missing type & incorrect usage (bf04ac3)
  • Linting (21f542d)
  • Return response on Errors, fixed linting (ac5fd4e)

📖 Documentation

  • Add new documentation (#134)

❤️ Contributors

v5.1.3

🩹 Fixes

  • Env variable is not used in production (87f1a5e)
  • RefreshTokens is not reset after logout (35024ed)

❤️ Contributors

v5.1.2

🩹 Fixes

  • Use createError instead of showError (#124)

❤️ Contributors

  • Matt

v5.1.1

🩹 Fixes

  • Missing import (9d421e6)

❤️ Contributors

v5.1.0

🚀 Enhancements

  • Changelog (313a5a2)
  • Add types for DirectusUser, DirectusFile and DirectusFolders (#113)
  • Improved error management (#120)
  • Add refresh token support (2898e0e)

🩹 Fixes

  • chore: Release command (f6e02fb)
  • chore: Add push arg to changelogen (5fbda08)

🏡 Chore

  • readme: Small improvements (#117)
  • readme: Update banner (94b6900)

❤️ Contributors

v5.0.0

🚀 Enhancements

  • Ability to pass custom image transformation presets and various docs fixes (#93)
  • Rendering section added to options.md (#96)
  • UseDirectusUsers composables to access built-in Users collection (#87)
  • ⚠️ Switch to pnpm, maintenance, removed directus graphql composable (45e2e04)
  • UseStaticToken options (6c17719)
  • Maintenance (a633f3a)

⚠️ Breaking Changes

  • ⚠️ Switch to pnpm, maintenance, removed directus graphql composable (45e2e04)

❤️ Contributors

v4.0.0

🚀 Enhancements

  • Ability to pass custom image transformation presets and various docs fixes (#93)
  • Rendering section added to options.md (#96)
  • UseDirectusUsers composables to access built-in Users collection (#87)
  • ⚠️ Switch to pnpm, maintenance, removed directus graphql composable (45e2e04)
  • UseStaticToken options (6c17719)

⚠️ Breaking Changes

  • ⚠️ Switch to pnpm, maintenance, removed directus graphql composable (45e2e04)

❤️ Contributors

3.2.2 (2022-11-17)

3.2.1 (2022-11-07)

Bug Fixes

  • auth: bug on switching accounts (620d312)

3.2.0 (2022-11-06)

Features

Bug Fixes

3.1.0 (2022-10-06)

Features

  • module: implemented support for revisions (5771b0a)

Bug Fixes

3.0.3 (2022-09-05)

Bug Fixes

  • module: error 500 when meta isnt defined (f84f0a9)

3.0.2 (2022-09-04)

Bug Fixes

  • module: autoimport hook deprecated (38eb525)

3.0.1 (2022-09-04)

Bug Fixes

  • module: compatibily issue (641a504)

3.0.0 (2022-08-28)

⚠ BREAKING CHANGES

  • main: getItems doesnt return meta

Features

  • add token to getThumbnail url query params (361e0a5)

Bug Fixes

  • main: getItems doesnt return meta (92b268c)

2.4.0 (2022-07-29)

Features

  • chore: added meta to param type (41d0bf2)

2.3.0 (2022-07-25)

Features

  • chore: implemented token auth option (45ad98f)
  • docs: added new option to docs (0cfc499)

Bug Fixes

  • :bug: playground fetch collection now works (2c4f260)

2.2.0 (2022-07-11)

Features

  • chore: archive to gitignore (3a1945a)
  • chore: updated cover & title readme (af14019)

Bug Fixes

  • docs: correct usage of getThumbnail (eb1b399)
  • throw error instead of type error login (fa310a2)

2.1.0 (2022-06-10)

Features

  • chore: implement fetch user params (2fe048a), closes #37
  • chore: integrate autoFetch user option (66d3dba), closes #37

Bug Fixes

  • stringify "deep" key on get item by id (1ca45b6)

2.0.2 (2022-05-27)

Bug Fixes

  • chore: missing Directus URL in .env (02c6bfe)
  • chore: missing Directus URL in .env (01f25b5)

2.0.1 (2022-05-18)

Bug Fixes

  • chore: getItemById returns undefined (cd8df17), closes #35
  • chore: merge options order (74c0d02)

2.0.0 (2022-05-06)

⚠ BREAKING CHANGES

  • chore: getItemById return an array of items

Features

  • docs: created docs for notifications (afacf8a)
  • main: created notification types (f0d8719)
  • main: implement notification support (7d0c5b9)
  • main: removed error throwing (7919b63)

Bug Fixes

  • chore: getItemById return an array of items (2ef29ce), closes #29
  • docs: buildModules to module (0731e38)
  • docs: setup buildModule (291b9e7)
  • docs: setup space (8268149)

1.8.0 (2022-04-24)

Features

  • chore: add graphql support (358bbf6)

Bug Fixes

  • chore: useDirectusFiles 500 error (5ca7a54), closes #23

1.7.1 (2022-04-23)

1.7.0 (2022-04-19)

Features

  • chore: created npmignore (a456c11)
  • module: added getFiles method (6c4b6bf)

Bug Fixes

1.6.0 (2022-04-14)

Features

  • chore: added deep query params support (a06fb19), closes #21

1.5.0 (2022-04-11)

Features

  • add global params support to getItemsByID (bbb161e)

1.4.0 (2022-04-09)

Features

  • added createUser method (0444c23)
  • examples: moved to directus repository (872545c)

Bug Fixes

  • updated middleware docs (67caccb)

1.3.0 (2022-04-03)

Features

Bug Fixes

  • naming issue (4707cab)
  • useDirectusAuth: remove typescript ignore (39098b3)
  • useDirectusAuth: remove typescript ignore (516e40e)

1.2.1 (2022-03-31)

1.2.0 (2022-03-31)

Features

  • update compatibility settings (391254c), closes #4

1.1.4 (2022-03-27)

Bug Fixes

  • missing import statement (2977a0b)

1.1.3 (2022-03-27)

Bug Fixes

  • update dependencies & package.json (1f2b91c)

1.1.2 (2022-03-27)

1.1.1 (2022-03-27)

1.1.0 (2022-03-27)

Features

Bug Fixes