<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [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 });
```

