vue-plugin-kuzzle
Version:
A Vuejs plugin shipping the Kuzzle SDK in your components
15 lines • 574 B
JavaScript
import { instantiateKuzzleSDK } from './helpers';
/**
* The VueKuzzle plugin. Makes the Kuzzle SDK available in Vue components as
* `this.$kuzzle`.
*
* @param Vue The Vue application to apply the plugin to
* @param options Options passed to the Kuzzle SDK constructor
*
* @see https://docs.kuzzle.io/sdk/js/7/core-classes/kuzzle/constructor/#options
*/
export const VueKuzzle = (Vue, options) => {
const sdkOptions = options?.sdkOptions ?? {};
Vue.prototype.$kuzzle = instantiateKuzzleSDK(options?.backends, sdkOptions);
};
//# sourceMappingURL=plugin.js.map