@empathyco/x-components
Version:
Empathy X Components
34 lines (21 loc) • 1.05 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [xPlugin](./x-components.xplugin.md)
## xPlugin variable
Vue plugin that modifies each component instance, extending them with the [X Component API](./x-components.xcomponentapi.md)<!-- -->.
**Signature:**
```typescript
xPlugin: XPlugin
```
## Example 1
Minimal installation example. An API adapter is needed to connect the X Components with the suggestions, search, or tagging APIs. In this example we are using the default Empathy's platform adapter.
```typescript
import { platformAdapter } from '@empathyco/x-adapter-platform';
Vue.use(xPlugin, { adapter: platformAdapter });
```
## Example 2
If you are using [Vuex](https://vuex.vuejs.org/) in your project you must install its plugin, and instantiate a store before installing the XPlugin:
```typescript
Vue.use(Vuex);
const store = new Store({ ... });
Vue.use(xPlugin, { adapter, store });
```