Typescript vue ky plugin.
Based on ky package
This plugin simply extend the vue object with ky. It can also create a base instance to use directly from vue.
npm install vue-ky-plugin --save
In your entry set:
import Vue from 'vue';
import KyPlugin from './vue-ky-plugin';
Vue.use(KyPlugin);
// or
import ky from 'ky';
Vue.use(KyPlugin, ky.extend({prefixUrl: 'https://example.com/api'}))
In your components just do
// just do
(async () => {
await this.$ky('unicorn', {prefixUrl: '/api'});
})();
Check ky github page