Using typescript directus SDK #100
stafyniaksacha
started this conversation in
General
Replies: 1 comment
-
I decided not to use the SDK, similar to the Strapi module. The best Nuxt support can be provided by doing it the Nuxt way with the Nuxt utilities. Modifying the SDK and wrapping all functions somehow has no added value for me. I will have a look at it though, I don't know if it has always been possible to customize the auth etc. A PR for better TypeScript support is already open and should be merged in the next days, see #79 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
This plugin has a nice integration with nuxt, but I'm wondering why don't use default Directus SDK which provide a powerful typescript integration.
It can be simply done by creating a custom Storage class, here is a working sample:
Usage would be same as official sdk:
That would solve typescript and errors managements issues that this module introduces regarding this SDK
We could go further by integrating a custom Transport layer to use fetch (via oh-my-fetch) instead of axios.
But this should be optional, since using axios is the default behavior of the SDK. It also allows having upload progress, which we can not have with fetch.
Beta Was this translation helpful? Give feedback.
All reactions